DevOps & Tooling / Knowledge library
Test Double
Substitutes a dependency with a controlled fake, stub, spy, or mock
Why learn Test Double?
It makes tests deterministic and able to exercise hard-to-produce conditions
The problem it solves
It isolates behavior from slow or unavailable collaborators
Where it came from
Test Double is a software testing technique that substitutes a dependency with a controlled fake, stub, spy, or mock. Its guarantees and tradeoffs depend on the concrete implementation and operating context.
Build your understanding
Work through these exercises in order. Try the task before opening a reference.
- Define Test Double and distinguish it from a neighboring concept.
- Choose a realistic task where Test Double is appropriate.
- Identify a failure mode caused by misusing Test Double.
- Interpret a small design or result involving Test Double.
- Explain one tradeoff or limitation of Test Double.
Documentation and sources
- ISTQB Glossary (glossary.istqb.org)