Concept: Test Doubles Types
Question
A 'dummy' test double is:
Hint
Dummy = placeholder, Stub = returns values, Spy = records calls, Mock = verifies expectations.
Explanation
A 'dummy' is the simplest test double — it's a placeholder object that is passed to satisfy an interface requirement but is never actually called or used in the test. The other types are: stub (returns preset values), spy (records calls), and mock (pre-programmed with expectations). The taxonomy comes from Gerard Meszaros' xUnit Test Patterns.
Related Resources
Related Lessons
- Stubs and Spies
Understanding test doubles.
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.