Skip to content

Commit 25f705a

Browse files
committed
docs: no pass-through tests — every test must assert meaningful behaviour
1 parent f808ef9 commit 25f705a

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

‎CLAUDE.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ When generating or modifying code in this project:
102102
- Repository → run the contract suite against every new implementation
103103
- New non-trivial validation rule → add a Hypothesis test (`@given`) to explore edge cases
104104
- Never use `unittest.mock` on domain code — if it's hard to test, it's a design signal
105+
- Every test must assert a meaningful behaviour — no pass-through tests written solely for coverage
105106
- New hot path (loop, algorithm, aggregation) → add a benchmark in `tests/examples/test_benchmarks.py`
106107

107108
**Security**

‎QUALITY.md‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,15 @@
6565
| pytest-benchmark | manual (`make benchmark`) | no | tests/examples/test_benchmarks.py |
6666
| E2E tests | CI (main) | no | tests/e2e/ |
6767

68+
## Test philosophy
69+
70+
Coverage is a proxy, not a goal. A test has value only if it can fail for the right reason.
71+
72+
- **Assert behaviour, not implementation** — test what the code does, not how it does it
73+
- **No pass-through tests** — a test that always passes regardless of the code is worse than no test
74+
- **One clear intent per test** — if a test breaks, it must be obvious why
75+
- **Coverage ≥ 80% is a floor, not a target** — chasing 100% produces noise; mutmut reveals gaps that coverage misses
76+
6877
## Local commands
6978

7079
```bash

0 commit comments

Comments
 (0)