# Analyze test run results to find failure patterns and gaps

Turns raw CI test results into clusters of failures, likely flaky tests, coverage gaps, and a prioritized fix list.

- Topic: Software Development
- Framework: RTF
- Level: Standard
- Tags: Analyze, Fill-in Template
- Source: https://www.thinkwithprompt.com/prompts/analyze-test-run-results-to-find-failure-patterns-and-gaps

## Prompt

```text
Analyze my automated test results and tell me what to fix first.

**Results data:** [PASTE - JUnit/XML summary, CI log excerpts, or a table of test name, status, duration, run date]
**Number of runs covered:** [e.g. "last 30 CI runs on main"]
**Coverage report, if any:** [PASTE or "none"]
**Recent changes:** [releases, dependency upgrades, infra changes in the period]
**What we care about most:** [release confidence / CI speed / flakiness]

Do this:
1. Summary metrics: pass rate per run, total failures, slowest tests, and the trend across runs.
2. Failure clusters: group failures by shared error message, stack frame, module, or environment, and give the likely common cause for each cluster.
3. Flaky test candidates: tests that pass and fail on the same code, with the evidence and the likely type (timing, ordering, shared state, external dependency, resource limits).
4. Real regressions: failures that started at a specific run or change.
5. Coverage gaps: risky areas (recently changed, frequently failing, or business-critical) with thin or no tests.
6. A prioritized action list: Item | Evidence | Impact | Effort | Owner suggestion.

Rules:
- Base every conclusion on the data I pasted and cite the test names or runs it rests on.
- Say clearly when the data is too thin to call something flaky versus broken, and tell me what extra data would settle it.
- Do not recommend deleting or permanently skipping a test without naming what risk that leaves uncovered.
```

## What to fill in

- e.g. "last 30 CI runs on main"
- PASTE or "none"
- releases, dependency upgrades, infra changes in the period
- release confidence / CI speed / flakiness

Free to copy and use. From ThinkWithPrompt (https://www.thinkwithprompt.com/), a library of 2,663 curated AI prompts.
