Skip to content
Back to skills

Test Doubles

ASecurity

Use fakes, stubs and mocks deliberately instead of mocking everything.

  • 3 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 3, 2026
developmentdatabase

Works with

  • cli

Security analysis

A100/100

Scanned September 3, 2026

npx -y skills add Andersseen/agentyx --skill test-doubles --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Test Doubles?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Test Doubles
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/andersseen-test-doubles/badge)](https://www.skillsdirectory.com/skills/andersseen-test-doubles)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
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.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…