The term comes from film "stunt doubles"; Meszaros coined the software sense in xUnit Test Patterns (2007), inspired by earlier work by Mackinnon, Freeman and Craig (2000).
The stunt double metaphor entered software through the Extreme Programming community in the early 2000s. Tim Mackinnon, Steve Freeman and Philip Craig described a "mock object" pattern at XP2000; Gerard Meszaros generalized it to "test double" in xUnit Test Patterns (2007). The metaphor is exact: a double performs the role of the original for the test, and returns to the wings when the scene is over.
Test Double is a generic term for any case where you replace a production object for testing purposes.
— Martin Fowler, *Mocks Aren't Stubs*, 2 January 2007