A dummy is a simple, hardcoded test double—such as a null value or made-up string—passed to the system under test only to satisfy a method signature. It does not participate in producing the final outcome. section 5.1 section 5.5
Use the classification to avoid confusing a dummy with more active substitutes:
- Treat dummies, stubs, spies, mocks, and fakes as test-double variations; distinguish them by their role in the test. section 5.1
- Use a stub when the dependency must provide configured input, and a mock when the test examines an interaction that changes state. section 5.1
- Do not assert a dummy’s interaction: it contributes neither input nor an observable side effect. section 5.5
Parameter-only dependency
A test can pass a null value or made-up string when a required parameter exists only because the SUT’s method signature requires it. If the value affects the result, it is no longer functioning as a dummy. section 5.1
Use the classification diagram to place dummies alongside stubs, spies, mocks, and fakes, then reduce the practical distinction to mocks versus stubs. section 5.1
