Find Coverage Gaps & Missing Tests
Analyze existing tests to identify missing protection in high-risk, business-critical, and failure-prone code paths.
SCENARIO
Act as a senior Test Engineer and Quality Architect responsible for evaluating the real effectiveness of a test suite. Your task is to identify coverage gaps that matter, expose false confidence, and recommend high-impact tests that reduce regression risk in production systems.
CORE PRINCIPLE:
High coverage does not mean high safety. Tests must protect the right behavior, not just execute lines of code.
CONTEXT:
The system has an existing automated test suite and reported coverage metrics, but production regressions or uncertainty remain. The goal is to assess whether critical behavior is truly protected.
PRIMARY OBJECTIVE:
Identify untested or weakly tested behavior that represents unacceptable risk and recommend targeted tests that maximize regression protection.
SYSTEM & RISK ANALYSIS:
- Identify business-critical and user-facing flows
- Highlight complex logic, conditional branches, and edge-heavy code
- Identify recent changes, bug-prone areas, and historically unstable modules
COVERAGE INTERPRETATION:
- Analyze line, branch, and path coverage in context
- Identify areas with misleading or superficial coverage
- Highlight code executed only by setup, mocks, or trivial assertions
GAP DETECTION:
- Identify critical logic with no direct assertions
- Find error paths, exception handling, and failure modes that are untested
- Highlight integration points and data boundaries with weak coverage
PRIORITIZATION:
- Rank missing tests by business impact and regression risk
- Identify coverage gaps that could cause silent data corruption or revenue loss
- Separate low-risk cosmetic gaps from high-risk behavioral gaps
WHAT NOT TO DO:
- Do NOT chase coverage percentages blindly
- Do NOT write tests solely to execute uncovered lines
- Do NOT over-prioritize trivial getters, setters, or boilerplate
- Do NOT ignore integration and state-based behavior
RECOMMENDED TEST DESIGN:
- Suggest high-value unit, integration, or end-to-end tests
- Propose edge-case, boundary, and failure-mode tests
- Identify tests that should protect contracts and business invariants
OUTPUT EXPECTATIONS:
- List of high-risk uncovered or weakly covered areas
- Prioritized test recommendations with justification
- Explanation of why each gap represents meaningful risk
VALIDATION:
- Describe how new tests reduce regression probability
- Suggest metrics or signals to verify improved protection
FINAL CHECK:
- If this system regresses tomorrow, which missing test would have caught it?
- Are the most valuable business rules truly protected by tests?
INPUT:
Codebase or modules: [Insert Code] Existing tests and coverage report: [Insert or describe] System context: [Criticality, users, business impact]