A programmer generally uses a test double to isolate the behavior of the consuming code from the rest of the codebase.
For example, a program that uses a database server is relatively slow and consumes significant system resources – which impedes testing productivity.
A test double might provide a static value instead of accessing a database.
Although not universally accepted, Gerard Meszaros[1] categorizes test doubles as: While there is no open standard for categories, Martin Fowler used these terms in his article, Mocks Aren't Stubs[2] referring to Meszaros' book.
Microsoft also used the same terms and definitions in an article titled, Exploring The Continuum Of Test Doubles.