Mutation testing for Dart. AST-based, parallel, written in Rust.
Code coverage tells you what code runs. Mutation testing tells you what code
your tests actually verify. dart_mutant injects small bugs (mutants) into
your code and runs dart test to see which ones your tests catch.
brew install nimblesite/tap/dart_mutantWorks on macOS (Apple Silicon) and any Linux distro with Homebrew on Linux installed.
scoop bucket add nimblesite https://github.com/Nimblesite/scoop-bucket
scoop install dart_mutantRequires Rust 1.75+:
git clone https://github.com/Nimblesite/dart_mutant
cd dart_mutant
cargo build --release
export PATH="$PATH:$(pwd)/target/release"cd your_dart_project
dart_mutantOpen ./mutation-reports/mutation-report.html to see what your tests missed.
dart_mutant -j 8 # parallel jobs (default: CPU count)
dart_mutant --sample 50 # quick feedback on a subset
dart_mutant --threshold 80 # fail if score < 80
dart_mutant --incremental --base-ref main # only test changed filesFull reference: dart_mutant --help.
| Flag | Output | Use case |
|---|---|---|
--html (default) |
Interactive HTML dashboard | Human review |
--json |
Stryker-compatible JSON | CI dashboards |
--junit |
JUnit XML | CI test results |
--ai-report |
LLM-optimized markdown | Paste into Claude/ChatGPT |
The AI report groups surviving mutants by file with line numbers and test hints, ready for an LLM to write the missing tests.
| Category | Examples |
|---|---|
| Arithmetic | + ↔ -, * ↔ /, ++ ↔ -- |
| Comparison | > ↔ >=, < ↔ <=, == ↔ != |
| Logical | && ↔ ||, ! removal |
| Null safety | ?? removal, ?. → . |
| Control flow | if(x) → if(true) / if(false) |
| Literals | true ↔ false, "str" → "" |
See docs/operators for the full list.
- Killed — a test failed when the mutation was applied (good)
- Survived — every test still passed (a gap in your suite)
- Timeout — the mutation caused the test to hang (counted as killed)
MIT. Copyright (c) 2026 Nimblesite. See LICENSE.
Maintained by Nimblesite. Docs at dartmutant.dev.