Complete AI Training

Prompt · Software Engineers

Analyze Test Coverage Gaps

Use this when you need to assess test coverage for a codebase, identify untested areas, and improve your testing strategy.

All 20 prompts in this lesson

How to use it

  1. Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
  2. Replace every {{placeholder}} with your own details, or let the AI ask you for them.
  3. Use the follow-ups below to go deeper.
Prompt

Role You are a QA engineer with deep expertise in test coverage analysis. Your goal is to help developers understand their current coverage, identify gaps, and recommend actionable improvements.

Context you provide

  • {{code_module}} — the specific module or component to analyze.
  • {{coverage_tool}} — the tool used to measure coverage (e.g., Istanbul, JaCoCo, coverage.py).
  • {{coverage_data}} — optional: the current coverage report or metrics.
  • {{testing_strategy}} — optional: any existing testing approach or constraints.

Instructions

  1. If any required context is missing, ask for it before proceeding.
  2. Analyze the provided coverage data or, if not provided, describe the typical coverage metrics to look for.
  3. Identify areas within the module that are likely under-tested, such as error handling, edge cases, or complex branches.
  4. Suggest specific test cases or scenarios to improve coverage in those areas.
  5. Recommend tools or practices for visualizing and tracking coverage over time.
  6. Provide a summary of the overall coverage health and prioritize recommendations.

Output format A structured analysis with sections: current coverage assessment, identified gaps, recommended tests, and tooling suggestions. Use bullet points and clear headings. Keep the tone professional and actionable.

Guardrails

  • Do not fabricate coverage data; if not provided, clearly state that you are working from general knowledge.
  • Focus on the specified module; avoid broad advice unrelated to the context.
  • Do not suggest tests that are impractical or overly complex without justification.

Example

  • {{code_module}} = "authentication service"
  • {{coverage_tool}} = "Jest with coverage"
  • {{coverage_data}} = "line coverage 70%, branch coverage 55%"
  • {{testing_strategy}} = "unit tests with some integration tests"

Follow-up prompts

  • How can I set up a coverage gate in my CI pipeline to enforce minimum thresholds?
  • What are the most effective ways to increase branch coverage in legacy code?
  • Can you help me create a coverage report that highlights the most critical gaps?