What this prompt does
This prompt sets up mutation testing for a [language] project using [mutation_tool]. Given your [test_framework] and current line coverage of [current_coverage]%, the AI walks through installing and configuring the tool, defining mutation operators relevant to [language] (arithmetic, boolean, return-value, method-call removal), scoping runs to [target_directories], setting a minimum Mutation Score Indicator of [msi_target]%, generating a survived-mutants report with suggested killing tests, wiring a CI quality gate, and listing the [top_count] most dangerous survivors with explanations.
The structure works because it measures whether tests actually assert anything. Line coverage only proves code ran; mutation testing changes the code and checks whether a test fails in response. By surfacing survived mutants — mutations no test caught — the prompt exposes the gap between decorative and protective tests. Scoping to [target_directories] and a realistic [msi_target] keeps the run focused and achievable.
When to use it
- You have high line coverage but suspect the tests do not really assert behaviour.
- You want to find which tests are decorative versus protective.
- You need a quality gate stronger than a coverage percentage.
- You want to focus mutation runs on high-value
[target_directories]. - You need a prioritised list of the most dangerous survived mutants to fix first.
- You are introducing mutation testing to a team and need it explained clearly.
Example output
You get [mutation_tool] configuration, a defined operator set for [language], a run scoped to [target_directories], an MSI threshold of [msi_target]%, a CI quality gate, and a report listing the [top_count] most dangerous survived mutants — each with what the mutation did, why no test caught it, and a suggested test to kill it.
Pro tips
- Point
[target_directories]at your highest-value logic first; mutation testing is slow, so scope matters. - Set
[msi_target]to a number the team can realistically reach, then ratchet it up over time. - Read the survived-mutants report carefully — each survivor is a concrete missing assertion, not a vanity metric.
- Keep
[current_coverage]honest so the contrast with your mutation score is meaningful. - Expect long run times; mutation testing re-runs the suite per mutant, so a narrow
[target_directories]keeps CI sane. - Use the suggested killing tests as drafts, then verify they assert the real behaviour the mutant broke.