Principles
Mutation-testing theory from primary literature: surviving mutants, operators, test strength, equivalent mutants, arid nodes, low scores, build gating…
от melodic-software★ 34 звезды на GitHub
Установить Principles в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Mutation Testing Knowledge Base
Distilled from the primary sources, the foundational papers, the industrial-scale reports, and the
tool documentation that defines the vocabulary everyone else borrows. Reference files in
reference/ are source-attributed; this file routes and answers the common questions without a load.
Routing Table
| Query about... | Load |
|---|---|
| Mutant states (killed/survived/no-coverage/timeout), operator catalogs, what a mutation actually is | operators-and-states.md |
| Mutation score, covered-code score, test strength, MSI, the oracle gap, what to report | metrics.md |
| Cost, diff-scoping, arid nodes, productive vs unproductive mutants, suppression, why not to gate | scaling-and-suppression.md |
| What each tool the audit drives supports, what to do when no tool exists | tooling.md |
| Equivalent mutants, coupling effect, competent programmer hypothesis, the theory | theory.md |
Quick decision guide (no load required)
"What is mutation testing?". Coverage tells you a line executed. It cannot tell you the line was checked. Mutation testing introduces a small deliberate fault (a mutant), re-runs the tests, and observes: tests fail → the mutant is killed, something genuinely asserted on that behavior; tests pass → the mutant survived, that line ran and nothing noticed it was wrong. The mutation is always reverted; the source is unchanged at the end.
"Is it just better coverage?". It answers a different question. Coverage measures execution; mutation testing measures fault detection. PIT states it directly: line coverage "does not check that your tests are actually able to detect faults." A file at 100% coverage and 40% mutation score has tests that run the code and assert almost nothing about it.
"Which number do I look at?". The covered-code one, always. Plain mutation score mixes two unrelated problems: "my tests are weak" and "I have no tests here." The covered-code variant (PIT calls it test strength, Infection calls it Covered Code MSI) isolates the first. A wide gap between the two means the coverage you have is thin, not that the tests are bad.
"Should we fail the build on a mutation score?". No, and this is the single most common way adoption fails. The score is depressed by equivalent mutants that no test can ever kill, so a hard threshold rewards suppressing mutants over writing tests. Report it; do not gate on it. Scaling and suppression mechanics: see scaling-and-suppression.md.
"Isn't this too slow to be practical?". Naive whole-repo mutation testing is, and that is why the technique sat unused for thirty years. The industrial answer is architectural, not computational: mutate only the changed lines, at most one mutant per line, suppress uninteresting nodes, and surface the result as a review-time prompt rather than a report. Google reports a median of 7 mutants per changelist under that regime against 820 for traditional mutagenesis.
"A mutant survived. Now what?". Three possible answers, and telling them apart is the whole skill:
- Productive, a real gap. Write a test that kills it.
- Equivalent, the mutated program is semantically identical to the original, so no test can kill it. Not a defect, not a suppression; the check itself is wrong for that node.
- Arid. Killable, but killing it would not improve the suite (a log line, a trivial accessor). Suppress it with a written reason.
"Why can't the tool tell me which?". Deciding equivalence is undecidable in general
(Jia & Harman). That is why the classification is a judgment step, and why
/mutation-testing:audit delegates it to a fresh context rather than to the context that authored
the tests.
"Mutants or hand-seeded faults?". Both plant a known fault and ask whether the tests notice.
A mutant comes from a fixed operator catalog applied to every eligible line, so its score is
repeatable and per line; a seeded fault is a realistic bug written by hand, so it tests the
suite against the kind of defect a developer ships. Andrews, Briand and Labiche (ICSE 2005) found
mutants behave like real faults while hand-seeded faults were harder to detect than real ones, so
a seeded result is an estimate of thoroughness, never a defect count. Seeding is
/mutation-testing:seed-faults.
Next
- No mutation run on the change yet:
/mutation-testing:audit. - The question is whether the suite catches realistic bugs:
/mutation-testing:seed-faults. - A survivor is judged productive:
/testing:write.
Related
- General test-design questions: /tdd:principles.
- Coverage or complexity caveats: /code-metrics:principles.
What this skill does NOT do
- Run a mutation tool. That is
/mutation-testing:audit. - Plant h
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- reference/metrics.md
- reference/operators-and-states.md
- reference/scaling-and-suppression.md
- reference/theory.md
- reference/tooling.md
FAQ
Что делает скилл Principles?
Mutation-testing theory from primary literature: surviving mutants, operators, test strength, equivalent mutants, arid nodes, low scores, build gating, coupling effect, and competent programmer hypothesis. Use when asking 'mutation score vs coverage', 'equivalent mutant', or 'what is an arid node'. Not for runs: /mutation-testing:audit.
Как установить скилл Principles?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл Principles запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
AnthropicGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
claude-api
AnthropicReference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
algorithmic-art
AnthropicCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
mcp-integration
AnthropicThis skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…