cargo-mutants
mutants.rs
- Free plan
- Linux
What cargo-mutants is
cargo-mutants is a free, open-source tool for mutation testing Rust code. It makes candidate changes to a program and checks whether the test suite catches them; a change that survives can point to a place where tests may be inadequate. Run `cargo mutants` in a Rust source directory to begin identifying such cases. The project says use does not require changes to the source tree or other setup before installation. Useful results depend on reliable, non-flaky tests that run under `cargo test` or `cargo nextest`. The tool supports parallel execution, incremental analysis, surviving-mutant reports and mutation quality gates. Its mutation operators include changing function-body values or binary operators, removing unary operators or match arms, replacing match guards and deleting struct-literal fields. Configuration can be kept in `.cargo/mutants.toml`; attributes and patterns can be used to skip or exclude changes. The project provides CI guidance, including GitHub Actions examples. It supports Cargo build systems on Linux, but does not support cross-compilation, so the source tree must build for the host platform. Building requires a reasonably recent stable, nightly or beta Rust toolchain. The project is MIT licensed and provided without warranty.
Who it suits
It suits Rust developers who want to check whether reliable `cargo test` or `cargo nextest` suites catch introduced code changes. Linux users with Cargo-based builds can also use its documented CI workflows.
Good to know, and what to watch
- Runs from a Rust source directory without source-tree changes.
- Supports `cargo test` and `cargo nextest`.
- Offers parallel execution and incremental analysis.
- Includes CI guidance and mutation quality gates.
- MIT licensed and free to use.
- Cross-compilation is not supported.
- Build systems other than Cargo are unsupported.
- Useful results depend on reliable, non-flaky tests.
- The project describes maintenance as semi-active in spare time.
The verdict
cargo-mutants gives Rust teams a way to find changes their tests fail to catch, including in incremental and CI workflows. It fits Cargo-based projects that build for the host platform and have dependable tests.
What the maker publishes
- Build system limit
- Build tools other than Cargo are not currently supported. source
- Build system limit
- Build tools other than Cargo are not currently supported. source
- CI
- The manual includes instructions and examples for testing mutants in CI, including incremental pull request testing and full development branch testing. source
- CI integration
- The project documents GitHub Actions workflows and says cargo-mutants emits structured annotations when it detects that it is running in an action. source
- Compatibility limit
- Cross-compilation is not currently supported, so the Rust tree must be buildable for the host platform. source
- Configuration
- Options can be configured in `.cargo/mutants.toml`, and the guide recommends checking that file into the source tree. source
- Dismiss findings
- Users can dismiss mutants with a `#[mutants::skip]` attribute or a configuration file. source
- Exclude mutations
- Items can be skipped with `#[mutants::skip]`, and specific mutations can be excluded with `#[mutants::exclude_re("pattern")]`. source
- Getting started
- You can run `cargo mutants` in a Rust source directory to identify functions that may be inadequately tested. source
- How to run
- Run `cargo mutants` in a Rust source directory to identify functions that may be inadequately tested. source
- Installation
- The project documents installation with `cargo install --locked cargo-mutants`, `cargo binstall`, or binaries from GitHub releases. source
- Installation
- The guide documents installation with `cargo install --locked cargo-mutants`, `cargo binstall`, or binaries from GitHub releases. source
- License and warranty
- The project is MIT licensed and provided as-is with no warranty of any kind. source
- Maintenance
- The repository describes the project as semi-actively maintained in spare time as of August 2026, with bug reports and pull requests read at higher latency. source
- Platform limit
- Cross-compilation is not currently supported; the source tree must be buildable for the host platform. source
- Purpose
- cargo-mutants is a Rust mutation testing tool that finds places where bugs could be inserted without causing tests to fail. source
- Purpose
- cargo-mutants is a mutation testing tool for Rust that finds places where bugs could be inserted without causing tests to fail. source
- Reproducibility
- Results should be reproducible when the build and test suite are deterministic. source
- Runtime
- A run’s duration depends roughly on the number of viable mutations multiplied by the time to run the test suite for each mutation. source
- Rust versions
- Building cargo-mutants requires a reasonably recent stable, nightly, or beta Rust toolchain. source
- Setup
- The tool requires no changes to the source tree or other setup before installation and use. source
- Support
- The project README invites users to share experience reports in GitHub Discussions and sponsor development. source
- Test requirements
- Useful results require reliable, non-flaky tests that run under `cargo test` or `cargo nextest`. source
- Test runners
- Useful results require reliable, non-flaky tests that run under `cargo test` or `cargo nextest`. source
Checked against the maker's pages on 5 Oct 2026.