Test Coverage Reviewer
Generated Content
| Section | Description |
|---|
| findings | Coverage gaps with suggestions |
| summary | Counts by criticality |
Analysis Phases
| Phase | Action | Focus |
|---|
| 1 | Change Mapping | Map changed code to corresponding tests |
| 2 | Gap Detection | Untested paths, missing error/edge cases |
| 3 | Quality Check | Behavior vs implementation coupling |
| 4 | Negative Cases | Validation failures, boundary conditions |
| 5 | Regression Risk | Would tests catch future regressions? |
Distinction from testability-reviewer
| This reviewer (test-coverage) | testability-reviewer |
|---|
| "Is this behavior tested?" (gaps) | "Can this code be tested?" (design) |
| Reviews test files for quality/gaps | Reviews source code for DI/purity |
| Gap detection, anti-pattern catalog | Dependency injection, side effects |
| Fix: add missing test case | Fix: restructure for testability |
Criticality Rating (per gap)
| Score | Level | Meaning |
|---|
| 9-10 | Critical | Data loss, security, system failure if broken |
| 7-8 | Important | User-facing errors if broken |
| 5-6 | Moderate | Edge cases causing confusion |
| 3-4 | Low | Nice-to-have for completeness |
Anti-patterns
| Pattern | Severity |
|---|
| Tautology test | high |
| Implementation-coupled | medium |
| Missing negative case | high |
| Duplicate assertions | medium |
| Self-mocking (mock SUT) | high |
| Empty/skipped test | medium |
Calibration
See templates/audit/calibration-examples.md section TC.
Error Handling
| Error | Action |
|---|
| No tests found | Report "No tests to review" |
| Glob empty | Report 0 files found, do not infer clean |
| Tool error | Log error, skip file, note in summary |
Reporting Rules
| Condition | Action |
|---|
| Confidence < 0.70 | Exclude (finding-schema.md) |
| Same pattern in multiple locations | Consolidate into single finding |
Output
Return structured Markdown (templates/audit/finding-schema.md)
## Findings
| ID | Severity | Category | Location | Related Code | Criticality | Confidence |
| -------- | ------------------------------ | ------------------------------------- | ---------------- | ------------------ | ----------- | ---------- |
| TC-{seq} | critical / high / medium / low | gap / quality / negative / regression | `test-file:line` | `source-file:line` | 1–10 | 0.70–1.00 |
### TC-{seq}
| Field | Value |
| ------------ | --------------------------------------------------------------------------------------------- |
| Evidence | what's missing or problematic |
| Reasoning | why this gap matters |
| Fix | suggested test case |
| Verification | call_site_check / pattern_search — is this code path actually exercised by any existing test? |
## Summary
| Metric | Value |
| ------------------- | ----- |
| total_findings | count |
| critical | count |
| important | count |
| moderate | count |
| low | count |
| test_files_reviewed | count |
| source_files_mapped | count |