âš¡ Powered by Rust & tree-sitter

Hunt Down Weak Tests

dart_mutant unleashes mutations on your Dart code to find tests that pass when they shouldn't. AST-based precision. Zero false positives. Blazing fast.

terminal
# Navigate to your Dart project
$ cd your_dart_project

# Run mutation testing
$ dart_mutant

  Discovering Dart files...
  Found 12 files, 847 mutation candidates
  Running mutation tests [████████████████████] 847/847

  Mutation Score: 87.2%
  Killed: 739  Survived: 108
Mutation Score 87.2%
739 Killed 108 Survived 0 Timeout

Why dart_mutant?

Code coverage lies. A line can be "covered" without being tested. Mutation testing reveals the truth.

🧬

AST-Based Mutations

Unlike regex-based tools, dart_mutant parses your code into an AST using tree-sitter. Only valid, meaningful mutations that compile.

âš¡

Blazingly Fast

Written in Rust with parallel test execution. Mutation test your entire codebase in minutes, not hours.

🎯

Zero False Positives

Smart exclusions for generated code, comments, and strings. Every surviving mutant is a real gap in your tests.

📊

Beautiful Reports

Dark-themed HTML reports with per-file breakdown. See exactly which mutations survived and where to add tests.

🔄

CI/CD Ready

JUnit XML output, threshold enforcement, and quiet mode. Fail builds when mutation score drops below target.

🤖

AI-Powered (Optional)

Use Claude or local LLMs to identify high-value mutation locations. Focus testing where it matters most.

How It Works

Mutation testing injects bugs into your code to verify your tests catch them.

1

Parse Your Code

dart_mutant scans your lib/ directory and builds an AST for each Dart file using tree-sitter. Generated files (*.g.dart, *.freezed.dart) are automatically excluded.

2

Generate Mutations

The AST is walked to find mutation candidates: arithmetic operators, comparisons, boolean literals, null-safety operators, and more. Each mutation is a small, targeted change.

3

Run Tests

For each mutation, dart_mutant modifies the source, runs dart test, and checks if any test fails. Mutations are tested in parallel for speed.

4

Report Results

Killed mutations = your tests caught the bug. Survived mutations = your tests missed it. The mutation score shows your true test effectiveness.

40+ Mutation Operators

dart_mutant applies a comprehensive set of mutations to thoroughly test your test suite.

Category Mutations
Arithmetic + → -, * → /, ++ → --
Comparison > → >=, == → !=, < → <=
Logical && → ||, ! → (removed)
Null Safety ?? → (removed), ?. → .
Control Flow if(x) → if(true), if(false)
Literals true → false, "string" → ""

View All Operators →

40+
Mutation Operators
10x
Faster than regex tools
0
False Positives
100%
Dart 3 Support

Ready to Hunt Mutants?

Stop trusting code coverage. Start mutation testing your Dart projects today.