TEST-003 critical test-requirements
New feature commits include tests
80%+ of feature commits have associated test changes (same commit or ±1 commit)
Question to ask
"What shipped last sprint with zero tests?"
Verification guide
Severity: Critical
Check automatically:
Sample recent feature commits:
# Get last 20 feature commits git log --oneline --grep="feat" --grep="add" --grep="feature" -n 20For each feature commit, check if test files were modified in that commit OR adjacent commits:
# Check the feature commit itself git show --name-only --pretty="" <commit-sha> | grep -E "\.(test|spec)\.(ts|js|py)$|tests/|__tests__/" # Check 1 commit before git show --name-only --pretty="" <commit-sha>~1 | grep -E "\.(test|spec)\.(ts|js|py)$|tests/|__tests__/" # Check 1 commit after (in case test added after) git show --name-only --pretty="" <commit-sha>^1 | grep -E "\.(test|spec)\.(ts|js|py)$|tests/|__tests__/"Calculate ratio: What percentage of feature commits have test changes in the commit or adjacent commits?
Cross-reference with:
- TEST-001 - tests must exist and run for this to matter
- TEST-002 - same pattern for bug fixes
Pass criteria:
- 80%+ of feature commits have associated test changes (same commit or ±1 commit)
Fail criteria:
- Most feature commits have no associated test changes
- Pattern of features shipped without tests
If low ratio, ask user: "Only X% of recent feature commits have associated test changes. Is there a process to require tests for new features?"
Evidence to capture:
- Number of feature commits sampled
- Number with associated test changes
- Percentage
- Example feature commits without tests (for review)