Test Doubles Strategy
Choosing between mocks, stubs, fakes, spies, and dummies based on testing needs.
Install
/plugin marketplace add sethdford/claude-skillsThe repo is a Claude Code plugin marketplace. Run /plugin afterwards to pick the plugin that includes this skill.
npx skills add sethdford/claude-skills --skill test-doubles-strategygit clone --depth 1 https://github.com/sethdford/claude-skills.git /tmp/claude-skills
mkdir -p ~/.claude/skills
cp -r /tmp/claude-skills/engineer/testing/skills/test-doubles-strategy ~/.claude/skills/test-doubles-strategyPersonal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.
From the SKILL.md
# Test Doubles Strategy Strategies for replacing real objects with test doubles. ## Context You are selecting the right test double for the job. Understand the tradeoffs of each approach. ## Domain Context - **Stub**: Returns canned answers; doesn't care how many times it's called - **Mock**: Expects specific calls; verifies behavior - **Fake**: Lightweight working implementation; slower but more realistic than stub - **Spy**: Records calls; can verify and allow through to real object - **Dummy**: Placeholder; passed but never used ## Instructions 1. **Stub**: Use when you need predictable return values; database returning test data 2. **Mock**: Use when you need to verify that a dependency was called correctly 3. **Fake**: Use for database or third-party service; test containers are modern fakes 4. **Spy**: Use when you need both verification and real behavior 5. **Dummy**: Use when dependency is required by signature but not used 6. **Avoid Over-Mocking**: If everything is mocked, you're not testing integration 7. **Prefer Fakes**: Modern practice uses test containers over mocks for external services ## Anti-Patterns - Mocking everything; you need at least some real code to test - Over-specifying mocks; brittle tests that fail on implementation changes - Mocking your own code; mock external dependencies, not your logic - Complex mock setup that's harder than the test; use factories or test builders
Details
- Skill name
test-doubles-strategy- Repository
- sethdford/claude-skills
- Path
engineer/testing/skills/test-doubles-strategy/SKILL.md- License
- MIT
- Repo updated
- 11 March 2026
FAQ
What does the Test Doubles Strategy skill do?
Choosing between mocks, stubs, fakes, spies, and dummies based on testing needs.
How do I install the Test Doubles Strategy skill?
Claude Code plugin: /plugin marketplace add sethdford/claude-skills. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.
Is Test Doubles Strategy popular?
It lives in sethdford/claude-skills, which has 48 GitHub stars and 10 forks.
Related skills
A B Test Design
48sethdford/claude-skills
Design rigorous A/B tests with hypotheses, variants, metrics, and sample size calculations.
A B Test Design Pm
48sethdford/claude-skills
Analytics and experimentation skill for product managers.
Abuse Case Design
48sethdford/claude-skills
Design abuse cases (negative use cases) showing how attackers misuse system features. Use when identifying attacks that exploit intended functionality or business logic flaws.
Test Effectiveness Measurement
48sethdford/claude-skills
Expert approach to test-effectiveness-measurement in quality measurement. Use when working with .
Test Data Strategy
48sethdford/claude-skills
Design test data management approaches. Use when planning data provisioning for testing.
Test Environment Management
48sethdford/claude-skills
Expert approach to test-environment-management in QA operations. Use when working with .
Browse the most popular Claude skills, all testing & qa skills, or write your own with the skills generator.