Mutation Testing

SkillDev tools

Run mutation testing with cargo-mutants to evaluate test quality. Identifies untested code paths.

Available today. Use it from your connected AI after setup.

Connect ahel once, and every AI you use reads what you have installed.

Then ask your AI: use the Mutation Testing skill

What this skill tells your AI

The instructions your AI receives, as published by nwiizo/cargo-coupling in .claude/skills/mutants/SKILL.md and read by ahel’s review.

Run cargo-mutants, analyze missed mutants, write tests for new code, verify fixes.

Workflow

  1. Run: Scope to changed files or specified targets
  2. Analyze: Focus on new/changed code missed mutants (ignore pre-existing)
  3. Fix: Add tests for missed mutants in new code
  4. Verify: Re-run on fixed functions to confirm 0 missed

Commands

# Scoped to specific files (recommended for incremental work)
cargo mutants --no-shuffle -j4 -f src/config.rs -f src/volatility.rs

# Scoped to specific functions
cargo mutants --no-shuffle -j4 -F "function_name"

# Full run (slow, 1000+ mutants)
cargo mutants --no-shuffle -j4 -- --lib

# Check results
cat mutants.out/missed.txt | grep "target_file.rs"
cat mutants.out/caught.txt | wc -l

Options

OptionDescription
-f <FILE>Limit to specific source file
-F <PATTERN>Filter by function name pattern
-E <PATTERN>Exclude by function name
-j <N>Parallel jobs (default: auto)
--no-shuffleDeterministic ordering
-- --libOnly run library tests

Result Interpretation

ResultMeaningAction
caughtTest detected mutationNone (good)
missedTest didn't detectAdd/improve test
unviableCompile error from mutationIgnore
timeoutTest too slowOptimize or skip

Triage Strategy

  • Pre-existing missed mutants in main.rs (CLI entry point): low priority, hard to unit test
  • Output formatting functions (report.rs, cli_output.rs): low priority unless logic-heavy
  • Business logic (config.rs, balance.rs, analyzer.rs): high priority
  • New code: always fix missed mutants before release

Signals

GitHub stars
96
Forks
2
Last commit
Sep 2026
Advanced
Catalog kind
skill
Gateway key
mutants
Source
github.com/nwiizo/cargo-coupling