Use fakes, stubs and mocks deliberately instead of mocking everything.
Scanned 9/3/2026
Install to Claude Code
npx -y skills add Andersseen/agentyx --skill test-doubles --agent claude-codeInstalls into .claude/skills of the current project.
Are you the author of Test Doubles?
Add the live security badge to your README — it updates automatically with every re-scan.
[](https://www.skillsdirectory.com/skills/andersseen-test-doubles)More formats (shields.io, HTML) on the badges page.
---
name: test-doubles
description: Use fakes, stubs and mocks deliberately instead of mocking everything.
---
# Test doubles
Replace a real dependency only when using it makes the test slow, non-deterministic, or impossible
to run.
## Prefer the real thing
Use the real implementation when it is fast and deterministic. In-memory databases, temporary
directories and local fakes usually beat a mock, because they exercise the actual contract.
## Match the double to the need
Use a stub to supply input, a fake for a working lightweight implementation, and a mock only when
the interaction itself is the behavior under test. Asserting on calls to a dependency that is not
the subject couples the test to implementation.
## Double boundaries you own
Replace your own abstraction over a third-party client rather than the client internals. When the
library changes shape, one adapter moves instead of every test.
## Keep doubles honest
A double that accepts calls the real dependency would reject turns a passing test into false
confidence. Verify the contract against the real implementation at least once.
Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.
No comments yet. Be the first to comment!