tests-doubles-and-isolation
Installation
SKILL.md
Tests Doubles And Isolation
Goal
Use test doubles to control dependencies while keeping tests readable, trustworthy, and resistant to harmless refactors.
For concise mocking examples, see MOCKING.md.
Vocabulary
- Fake: generic replacement that looks like a real collaborator.
- Stub: fake used to feed controlled input or errors into the unit. A stub should not decide whether the test passes.
- Mock/spy: fake used to verify an interaction. It can fail the test.
- Isolation framework: library that creates and configures fakes dynamically.
If the project or framework uses different names, keep the conceptual distinction clear in variable names.