CheckOps home

Tools directory

C

CheckOps

cargo-mutants

cargo-mutants is an MIT-licensed mutation testing tool for Rust that injects bugs into your code and reports which ones your tests miss, with nextest support, sharding and diff-based runs.

Visit website

Latest public signals

Not refreshed yet. Refresh reads the public site and, when the entry has a GitHub repository, the latest release.

Visit Website

Introduction

cargo-mutants helps you improve your Rust program’s tests by finding places where bugs could be inserted without any tests failing. It generates mutants, for example replacing a function body with a default return value or swapping binary operators, builds each, and runs your tests. Mutants that are not caught (“missed”) highlight weak tests or untested behaviour.

It needs no changes to your source code: install the cargo subcommand and run cargo mutants in a workspace. Results are written to a mutants.out directory with lists of caught, missed, unviable and timed-out mutants and diffs. Options include running tests with cargo-nextest (--test-tool nextest), parallel jobs, sharding across CI machines (--shard), testing only code changed in a diff (--in-diff), excluding functions with attributes or config, and timeouts. Its documentation at mutants.rs includes CI recipes. Version 27.1.0 was released on 2 June 2026, with commits in October 2026.

The source code is at sourcefrog/cargo-mutants on GitHub under the MIT licence, with about 1,400 stars; the most recent commit was on 19 October 2026.

Features

  1. No source changes: Works on existing Rust projects.
  2. Clear outcomes: Caught, missed, unviable and timeout lists.
  3. CI-friendly: Sharding, diff-only runs and nextest support.
  4. Configurable: Exclude functions and files.

Pros

  1. Free to use: Open source under the MIT licence, so the core tool costs nothing to use.
  2. Actively maintained: The repository had commits as recent as 19 October 2026.

Cons

  1. Build-heavy: Each mutant requires compilation, so full runs take time.
  2. Interpreting results: Some missed mutants are equivalent and need judgement.
cargo install --locked cargo-mutants
cargo mutants
cargo mutants --test-tool nextest -j 4
git diff origin/main > pr.diff && cargo mutants --in-diff pr.diff

Resources:

Pricing

cargo-mutants is free and open source under the MIT licence.

  1. Rust teams wanting to measure how strong their tests are.
  2. CI pipelines checking mutants only in changed code.

Conclusion

cargo-mutants makes mutation testing practical for Rust, with zero setup and good CI support.

Alternatives

Other tools on CheckOps that cover similar ground. Open a page, or compare one with cargo-mutants side by side.