- Every behavior change should have a test or a documented reason why not (e.g. generated code, third-party UI with separate E2E).
- Prefer fast unit tests for logic; integration tests for boundaries (DB, HTTP, filesystem) with clear fixtures.
- Tests should be deterministic: fixed clocks, seeded randomness, isolated temp dirs.
- Name tests after behavior (e.g. “returns 404 when missing”), not after implementation details.
- Failures should print actionable diagnostics (inputs, diff, key IDs), not only “expected false got true.”
Applies to common test paths (e.g. **/*.test.ts, **/*.spec.ts, **/__tests__/**, **/*_test.py, **/*_test.go, or your repo’s convention).
- Prefer deterministic tests; avoid wall-clock sleeps for synchronization.
- Name tests for behavior, not internal implementation names.
tdd— Test-driven workflow and references.get-ci-green— CI failures and flaky tests.release-readiness— Ship gate including test expectations.