Skip to content

Test Double

Medium — good to knowTesting

ELI5 — The Vibe Check

Test double is the umbrella term for anything that replaces a real dependency in a test. Mocks, stubs, spies, fakes — they're all test doubles. Like how 'stunt double' covers all the different types of stunt performers. Mock is just the most famous type.

Real Talk

A test double is any object that stands in for a real dependency during testing. The term (coined by Gerard Meszaros) encompasses stubs (fixed responses), mocks (verifiable behavior), spies (call recording), fakes (simplified implementations), and dummies (placeholder objects).

When You'll Hear This

"Replace that external dependency with a test double." / "Whether you call it a mock or stub, it's all a test double."

Made with passive-aggressive love by manoga.digital. Powered by Claude.