File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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**
Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments