Scan the codebase for spec requirements that have no corresponding tests. For each gap, provide a specific suggestion for what to test, which test type to use, and where to add the test file. Designed for quick post-implementation audits and CI integration.
-
Extract Requirements: Parse spec.md for all testable items.
- Requirements from
## Requirements
- Scenarios from
## User Scenarios & Testing
- Success criteria from
## Success Criteria
- Technical decisions from
plan.md (if present)
-
Scan Existing Tests: Find all test files and extract their coverage targets.
- Parse test names, describe blocks, and comments
- Build a set of "covered topics" from existing tests
-
Identify Gaps: Compare requirements against covered topics.
- For each requirement, search for matching tests
- If no match found → it's a gap
- Classify gap severity based on requirement importance
-
Generate Gap Report: List every untested requirement with actionable suggestions.
## Untested Requirements
| # | Requirement | Severity | Suggested Test | File |
|---|------------|----------|----------------|------|
| 1 | Rate limiting on login endpoint | 🔴 Critical | Integration test: verify 429 after N attempts | `tests/integration/rateLimit.test.ts` |
| 2 | Email verification flow | 🟡 Medium | Unit test: verify token generation + expiry | `tests/unit/auth/verify.test.ts` |
| 3 | Admin can deactivate users | 🟡 Medium | E2E test: admin dashboard deactivation flow | `tests/e2e/admin.test.ts` |
**3 gaps found across 8 requirements (62.5% covered)**
-
Prioritized Action List: Rank gaps by severity and suggest implementation order.
## Recommended Test Order
1. 🔴 **Rate limiting** — security requirement, test first
- What to test: send N+1 requests, verify 429 response
- Framework: supertest + jest
- Estimated: 1 test file, 3-4 test cases
2. 🟡 **Email verification** — user-facing flow
- What to test: token generation, token expiry, invalid token handling
- Framework: jest unit tests
- Estimated: 1 test file, 4-5 test cases
3. 🟡 **Admin deactivation** — admin feature
- What to test: deactivate user, verify login blocked, verify reactivation
- Framework: playwright or cypress E2E
- Estimated: 1 test file, 3 test cases
-
Quick Summary: One-line pass/fail suitable for CI output.
SPECTEST GAPS: 3 untested requirements (2 critical, 1 medium) — 62.5% coverage