mutant-survival-triage
Use when a mutation testing run (StrykerJS, PIT, mutmut or Mull) has surviving mutants, a low mutation score, or a large report to work through: classifies…
от testland★ 18 звёзд на GitHub
Установить mutant-survival-triage в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
mutant-survival-triage
Turns "this mutant survived" into "here is the specific test that would kill it, and here is the input that separates the mutant from the original."
What this owns, and what it does not
Owns: one surviving mutant at a time. Reading the mutated line and the tests that already covered it, deciding which of five reasons explains the survival, and writing a concrete test proposal (inputs plus the assertion) that would flip the mutant to killed.
Does not own: installing or configuring a mutation testing tool, choosing mutate globs, picking a mutation-score threshold, or wiring a build gate. Those are per-tool configuration decisions and are settled before a report exists. This work starts at the report and ends at a test proposal a human writes.
Running the triage as an investigation
Inputs: a mutation report (Stryker JSON, PIT XML, mutmut output, Mull JSON)
and the source repo at the same commit. For each surviving mutant: read the
report entry, the mutated line with its surrounding context, and the tests
that executed the line without killing it (git log / git blame help date
the line and its tests); then classify (Step 2) and propose (Step 4).
Ground rules for the investigation - it is read-only:
- Never auto-rewrite tests. Recommendation only; the team writes the test (or accepts the equivalent-mutant explanation).
- Never mark a mutant equivalent without surfacing the reasoning. The reviewer must be able to disagree (Step 5).
- Skip code under mutation-suppression pragmas (e.g. mutmut's
# pragma: no mutate) - the team explicitly opted out.
Downstream hand-offs: weak-assertion survivors → test-code-critic
(qa-test-review, assertion dimension); flaky-killer survivors →
e2e-flake-bisector (qa-flake-triage, shared-state isolation stage);
"where to add tests" rather
than "what to test" → test-coverage-targeter (qa-test-reporting).
Step 1 - Normalize the survivor into one record
Every tool reports the same underlying facts in a different container. Flatten each survivor into one record before classifying, so the heuristics below stay tool-independent:
interface SurvivedMutant {
tool: 'stryker' | 'pit' | 'mutmut' | 'mull';
file: string;
line: number;
column?: number;
mutator: string; // tool-native operator name, kept verbatim
original: string; // the source text before mutation
mutated: string; // the source text after mutation
coveredBy: string[]; // tests that executed the line and did not kill it
}
Where each field comes from per tool, and why the non-killed statuses must not be
merged (Survived vs NoCoverage / no-coverage, Timeout, and the rest), is in
references/tool-normalization.md. One rule from
there is load-bearing for Step 2: a no-coverage mutant is never a weak-assertion
finding, because no assertion ran.
Step 2 - Classify why it survived
Work the classes in this order. The cheap, tool-asserted ones come first, and
equivalent-mutant comes last because it is the only class that cannot be
proven (Step 5).
| Class | Signal to look for | Recommended action |
|---|---|---|
unreachable |
The tool reported no coverage, or the line sits in a path no caller can reach. | Delete the dead code, or record why the path is intentionally unexecuted. |
flaky-killer |
The same mutant id is killed in one run and survives in another with no source change; the covering test also appears in flake history. | Stabilize the covering test first, then re-run the mutant. A flaky test is not a mutation finding. |
missing-case |
The covering tests never supply an input on which the original and the mutant produce different observable behavior. | Add one test at the separating input (Step 3 gives the input per mutator). |
weak-assertion |
A covering test does exercise a separating input, but its assertion is too loose to observe the difference. | Tighten that assertion to the exact expected value, then re-run. Do not add a second test. |
equivalent-mutant |
No input exists on which the mutant and the original differ observably. | Record the reasoning, exclude the mutant, and accept the score cost (Step 5). |
The missing-case versus weak-assertion split is the whole decision: both look
identical in the report, and only reading the covering test tells them apart. Ask
one question: did any covering test already run the separating input? If yes
the test is the defect; if no the suite is.
Step 3 - Per-mutator heuristics
The four mutation families below cover most survivors. Tool operator names differ, so match on the family, not the string. The full operator-name-to-family mapping across StrykerJS, PIT, mutmut, and Mull, with sources, is in references/tool-normalization.md.
Conditional boundary
if (qty > maxQty) throw new Error('Cap exceeded'); // original
if (qty >
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- .tessl-plugin/plugin.json
- evals/build-gate-red-and-the-tests-wanted-by-friday/criteria.json
- evals/build-gate-red-and-the-tests-wanted-by-friday/task.md
- evals/refund-window-survivor-and-the-day-30-complaints/criteria.json
- evals/refund-window-survivor-and-the-day-30-complaints/task.md
- evals/release-signoff-two-dashboards-two-scores/criteria.json
- evals/release-signoff-two-dashboards-two-scores/task.md
- evals/sprint-grooming-a-survivor-list-with-no-test-links/criteria.json
- evals/sprint-grooming-a-survivor-list-with-no-test-links/task.md
- evals/zero-survivors-mandate-for-the-quarter/criteria.json
- evals/zero-survivors-mandate-for-the-quarter/task.md
- references/tool-normalization.md
FAQ
Что делает скилл mutant-survival-triage?
Use when a mutation testing run (StrykerJS, PIT, mutmut or Mull) has surviving mutants, a low mutation score, or a large report to work through: classifies each survivor (missing case, weak assertion, equivalent, unreachable, flaky), drafts the test or assertion that kills it, and states the mutation score with its formula. Does not rewrite tests automatically.
Как установить скилл mutant-survival-triage?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл mutant-survival-triage запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
docx
AnthropicUse this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include…
AnthropicUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple…
xlsx
AnthropicUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing…
pptx
AnthropicUse this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or…