| name | dev-testing |
| description | Gate 3 of development cycle - ensures unit test coverage meets threshold (85%+)
for all acceptance criteria using TDD methodology.
|
| trigger | - After implementation and SRE complete (Gate 0/1/2)
- Task has acceptance criteria requiring test coverage
- Need to verify implementation meets requirements
|
| NOT_skip_when | - "Manual testing validates all criteria" → Manual tests are not executable. Gate 3 requires unit tests.
- "Integration tests are better" → Gate 3 scope is unit tests only.
- "Coverage is close to 85%" → Close enough is not passing. Meet exact threshold.
|
| sequence | {"after":["dev-implementation","dev-devops","dev-sre"],"before":["requesting-code-review"]} |
| related | {"complementary":["test-driven-development","qa-analyst"]} |
| input_schema | {"required":[{"name":"unit_id","type":"string","description":"Task or subtask identifier"},{"name":"acceptance_criteria","type":"array","items":"string","description":"List of acceptance criteria to test"},{"name":"implementation_files","type":"array","items":"string","description":"Files from Gate 0 implementation"},{"name":"language","type":"string","enum":["go","typescript","python"],"description":"Programming language"}],"optional":[{"name":"coverage_threshold","type":"float","default":85,"description":"Minimum coverage percentage (cannot be below 85)"},{"name":"gate0_handoff","type":"object","description":"Full handoff from Gate 0"},{"name":"existing_tests","type":"array","items":"string","description":"Existing test files"}]} |
| output_schema | {"format":"markdown","required_sections":[{"name":"Testing Summary","pattern":"^## Testing Summary","required":true},{"name":"Coverage Report","pattern":"^## Coverage Report","required":true},{"name":"Traceability Matrix","pattern":"^## Traceability Matrix","required":true},{"name":"Handoff to Next Gate","pattern":"^## Handoff to Next Gate","required":true}],"metrics":[{"name":"result","type":"enum","values":["PASS","FAIL"]},{"name":"coverage_actual","type":"float"},{"name":"coverage_threshold","type":"float"},{"name":"tests_written","type":"integer"},{"name":"criteria_covered","type":"string","description":"X/Y format"},{"name":"iterations","type":"integer"}]} |
| verification | {"automated":[{"command":"go test ./... -covermode=atomic -coverprofile=coverage.out && go tool cover -func=coverage.out | grep total","description":"Go tests pass with coverage","success_pattern":"total:.*[8-9][0-9]|100"},{"command":"npm test -- --coverage | grep -E 'All files|Statements'","description":"TypeScript tests pass with coverage","success_pattern":"[8-9][0-9]|100"}],"manual":["Every acceptance criterion has at least one test","No skipped or pending tests"]} |
| examples | [{"name":"TDD for auth service","input":{"unit_id":"task-001","acceptance_criteria":["User can login with valid credentials","Invalid password returns error"],"implementation_files":["internal/service/auth.go"],"language":"go"},"expected_output":"## Testing Summary\n**Status:** PASS\n**Coverage:** 89.5%\n\n## Coverage Report\n| Package | Coverage |\n|---------|----------|\n| internal/service | 89.5% |\n\n## Traceability Matrix\n| AC | Test | Status |\n|----|------|--------|\n| AC-1 | TestAuthService_Login_ValidCredentials | ✅ |\n| AC-2 | TestAuthService_Login_InvalidPassword | ✅ |\n\n## Handoff to Next Gate\n- Ready for Gate 4: YES\n"}] |