mutation-testing

Verifies test effectiveness by mutating production code and checking whether tests detect the changes.

Updated May 30, 2026
One-click install
npx skills add https://github.com/chloebrett/snitchos --skill mutation-testing-chloebrett
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: mutation-testing
Source: https://github.com/chloebrett/snitchos/tree/main/.claude/skills/mutation-testing
Command: npx skills add https://github.com/chloebrett/snitchos --skill mutation-testing-chloebrett

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Code coverage only shows which lines your tests execute, not whether they would catch real bugs. This Skill closes that gap by systematically introducing small mutations into changed code and running the test suite to see which mutants survive, revealing weak or missing tests. ## Core Features & Use Cases - Manual Mutation Workflow: Step-by-step process to mutate operators (arithmetic, conditional, logical, boolean), run tests, and classify mutants as killed or survived. - Mutation Operator Reference: Comprehensive tables of operator mutations for TypeScript/JavaScript and Rust, with weak vs. strong test examples for each. - cargo-mutants Integration: Commands for automated mutation testing in Rust projects, including incremental diff-based runs on branches. - Use Case: After finishing a TDD cycle on a branch, run mutation analysis on the changed files to confirm your tests catch boundary errors, inverted conditions, and removed statements before refactoring. ## Quick Start Analyze the changed code on my current branch with mutation testing and report which mutants survived my test suite.

Frequently Asked Questions about mutation-testing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I check if my tests actually catch bugs?▼

Use mutation testing: introduce small changes like flipping operators or negating conditions in production code, then run your test suite. If tests fail, the mutant is killed; if they pass, your tests have a gap that needs a stronger or new test.

What is the difference between code coverage and mutation testing?▼

Code coverage measures which lines your tests execute, while mutation testing measures whether tests detect changes to that code. A suite with 100% coverage can still miss many bugs if tests lack meaningful assertions.

How do I run mutation testing on a Rust project?▼

Install cargo-mutants with cargo install cargo-mutants, then run cargo mutants for the full workspace or cargo mutants --in-diff with a git diff to mutate only changed files on a branch. Surviving mutants indicate tests that need strengthening.

Which mutations most commonly survive test suites?▼

Boundary mutations like >= changed to >, logical operator swaps like && to ||, and arithmetic changes tested only with identity values like 0 or 1 are the most common survivors. Testing boundary values and mixed boolean inputs kills them.

What should I do about equivalent mutants?▼

Equivalent mutants produce identical observable behavior to the original code, so no test can kill them. Identify and document why the mutant is equivalent, accept that 100% mutation score may be unreachable, and consider whether the code could be clearer.

When should mutation testing run in a TDD workflow?▼

Run mutation analysis after the green phase and before refactoring, in a RED-GREEN-MUTATE-REFACTOR cycle. This validates test strength before restructuring code whose safety net has not been verified.