Test Coverage
Write valuable tests that improve confidence and coverage; prefer behavior likely to regress over assertions that only inflate percentages.
Quick Start
- Explore the repo and run
scripts/repo_test_probe.pyfrom the skill directory to infer stack, tooling, and coverage artifacts. - Use coverage reports for cold spots, or infer gaps from changed code, complex logic, public APIs, and error-handling branches.
- Match the project's existing style, fixtures, and naming; run the narrowest test command first, then broaden until coverage improves.
Pick High-Value Targets
- Prioritize: branchy business logic, error handling/retries/validation, serialization/parsing/adapters, bug-prone changes, public entry points.
- De-prioritize: thin wrappers, snapshot-heavy/implementation-coupled tests (unless already relied on), mock-only assertions with no observable outcome.
Guardrails
- Assert outputs and observable behavior, not lines; cover success, failure, and edge cases.
- Do not chase 100% coverage over value, rewrite unrelated tests, or add a new framework if one exists.
- If hard to test due to design issues, note the seam and add the best regression coverage feasible.
References
REFERENCE.mdfor target selection heuristics and framework signals.scripts/repo_test_probe.pyto inspect the repo before choosing commands or file locations.