# Writing Tests

> How to write, change, or review tests — the load-bearing rule is test real behavior, not source text. Also covers non-vacuity (prove the test can fail), e2e tests that secretly stub the component they name, drift guards as a design smell to name rather than launder, SSOT contract tests that must move with their data, stubs that must drain stdin, and the Python test idioms (repo-root discovery, exec()-ing a module's main, from future import annotations) that bite under pytest-xdist. Activate whenever the user asks to write, add, fix, refactor, strengthen, or review tests ("write a test", "add tests", "test this", "regression test", "cover this", "why didn't this test catch it"), or when a coding task's last step is testing the change you just made.

## Facts
- Page: https://tashan.sh/capability/skill-alexandermattturner-writing-tests
- tashan id: skill:AlexanderMattTurner/writing-tests
- Source: https://github.com/AlexanderMattTurner/agent-sanitizer
- Type: skill
- Category: devtools
- tashan score: 52.0 / 100
- Adoption: 14.0
- Upkeep: 100.0
- Freshness: 100.0
- Evidence coverage: 84% of the inputs this score can use
- Health: active
- Instruction depth: not yet graded
- License: Apache-2.0
- Official: no

## Install

```sh
cp -r writing-tests ~/.claude/skills/
```

## Security audit
Not scanned. We audit npm-published capabilities; this one has no npm package we can resolve, or has not reached the queue. This is not a clean bill of health.

---
Measured 2026-08-10 by tashan (https://tashan.sh) from public evidence. Scorer s5.
