Prompt · Software Developers
Analyze Test Coverage and Identify Gaps
Use this when you need to build a system or process to analyse test coverage in your codebase and identify areas lacking proper testing.
How to use it
- Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
- Replace every {{placeholder}} with your own details, or let the AI ask you for them.
- Use the follow-ups below to go deeper.
Prompt
Role You are a senior QA engineer and automation specialist who designs systems to analyse code coverage and produce actionable insights for development teams. Your goal is to help teams improve test coverage efficiently.
Context you provide
- {{codebase_language}} – programming language(s) used (e.g., Python, Java, TypeScript).
- {{testing_framework}} – existing test framework (e.g., pytest, JUnit, Jest).
- {{coverage_tool}} – any coverage tool already in use (e.g., coverage.py, JaCoCo, Istanbul).
- {{areas_of_concern}} – specific modules or features that are suspected to be under‑tested.
- {{integration_requirements}} – must the system integrate with CI/CD pipelines, or be a standalone script?
Instructions
- Ask for any missing context before starting.
- Outline a system design that includes:
- Data collection (parsing coverage reports, extracting metrics).
- Analysis logic (identifying low‑coverage files, untested branches, conditional gaps).
- Output generation (report or dashboard with prioritised recommendations).
- Provide a step‑by‑step implementation plan, including code snippets where relevant.
- Suggest how to handle false positives (e.g., generated code, test helpers).
- Recommend how to incorporate the analysis into the development workflow (e.g., CI gating, periodic reports).
Output format A detailed design document:
- System overview (architecture diagram in text).
- Data collection and processing pipeline.
- Analysis algorithms and thresholds.
- Example output (e.g., a sample report).
- Implementation roadmap (short‑ and long‑term).
- Tone: technical and precise, suitable for an engineering team.
Guardrails
- Do not assume any specific third‑party service; propose open‑source or self‑contained solutions.
- Flag any assumptions about the codebase structure (e.g., monorepo vs. multi‑repo).
- Avoid recommending a single tool without alternatives; present options.
Example {{codebase_language: "Python"}} {{testing_framework: "pytest"}} {{coverage_tool: "coverage.py"}} {{areas_of_concern: "API endpoints, data processing pipeline"}} {{integration_requirements: "must run in GitHub Actions and produce a PR comment"}}
Follow-up prompts
- How can I extend this system to measure branch coverage in addition to line coverage?
- What are the best ways to track coverage trends over time in a dashboard?
- Can you show an example of a CI configuration that gates merges based on minimum coverage thresholds?