FREEDOM251

Freedom251 › Mutation Testing Tools

muttest-rs

Free plan

Visit muttest-rs Alternatives

muttest-rs's own site

What muttest-rs is

muttest-rs is a free, open-source Rust tool for evaluating whether tests detect code changes that simulate bugs. It creates mutations in selected source and runs a test suite against them, then writes a JSON report to `target/muttest/report.json`, including surviving mutants. The documented setup installs the `cargo-muttest` Cargo plugin and adds `muttest` as a crate dependency. For library analysis, developers annotate code and test modules, run `cargo muttest --lib`, and inspect the report. Integration tests can use `muttest` as an optional dependency, guard attributes with the `muttest` feature, and run `cargo muttest` without `--lib`. The `#[mutate]` macro transforms selected patterns and inserts runtime hooks, allowing mutations after one compilation. Runtime expressions can be mutated, but const or static definitions, const functions, macros and arguments, patterns, and types cannot. Only top-level module items accept annotations. An optional Cargo profile uses optimization level 3 and link-time optimization. The project uses the MIT license and advises keeping it out of release code.

Who it suits

It suits Rust crate developers using Cargo tests who want mutation analysis and surviving-mutant reports. Teams should review its mutation and annotation limits before configuring a suite.

What it does well

  • Open-source MIT-licensed project
  • Reports surviving mutants in JSON
  • Supports library and integration tests
  • Runtime hooks allow one compilation
  • Optional optimized Cargo profile

What to know first

  • Rust-only support
  • Cannot mutate several code categories
  • Annotations limited to top-level module items
  • Must keep muttest out of release code

Limits

Mutations apply only to runtime-executed expressions and cannot target const or static definitions, const functions, macros or their arguments, patterns, or types. The #[mutate] annotation is limited to top-level items in modules.

Getting started

  1. Install the cargo-muttest Cargo plugin
  2. Add muttest as a crate dependency
  3. Annotate library code and test modules with the documented attributes
  4. Run cargo muttest --lib for library analysis
  5. Inspect target/muttest/report.json
  6. Use the optional dependency and muttest feature guards for integration tests
  7. Run cargo muttest without --lib for integration analysis

Verdict

muttest-rs gives Rust developers a focused way to measure whether tests catch simulated defects. Its documented workflow and mutation restrictions should guide setup and interpretation.

Questions

What language does muttest-rs support?

It supports Rust projects using Cargo tests.

Is muttest-rs open source?

Yes. The repository identifies the MIT license.

Where is the mutation report written?

Library analysis writes a JSON report to target/muttest/report.json.

Can it analyze integration tests?

Yes. Add muttest as an optional dependency, guard attributes with the muttest feature, and run cargo muttest without --lib.

How does the mutation macro work?

The #[mutate] macro transforms selected source patterns and adds runtime hooks so mutations can be enabled after one compilation.

How can command debugging be enabled?

Set RUST_LOG=debug to display the commands executed during mutation analysis.

Facts from muttest-rs's own pages

Annotation limit
Only top-level items in modules can be annotated with `#[mutate]`. · github.com, 4 Oct 2026
Annotation limits
For technical reasons, only top-level items in modules can be annotated with `#[mutate]`. · github.com, 9 Oct 2026
Debugging
Setting `RUST_LOG=debug` displays the commands executed during mutation analysis. · github.com, 4 Oct 2026
How it works
Its `#[mutate]` macro transforms source code patterns and adds hooks so mutations can be enabled at runtime after a single compilation. · github.com, 9 Oct 2026
Installation
The README instructs users to install the `cargo-muttest` Cargo plugin and add `muttest` to their crate. · github.com, 9 Oct 2026
Integration tests
The README says integration test analysis uses `muttest` as an optional dependency and runs `cargo muttest` without `--lib`. · github.com, 9 Oct 2026
Intended users
The documented setup is for Rust crate developers who want to assess how well their tests detect code changes. · github.com, 9 Oct 2026
License
The repository includes an MIT license that permits use, copying, modification, distribution, sublicensing, and sale subject to its terms. · github.com, 9 Oct 2026
Mutatable code
The tool can mutate runtime-executed expressions, but not const or static definitions, const functions, macros and their arguments, patterns, or types. · github.com, 4 Oct 2026
Mutation limits
It cannot mutate const or static definitions, `const fn`s, macros or their arguments, patterns, or types. · github.com, 9 Oct 2026
Performance
The README documents an optional `muttest` profile with optimization level 3 and LTO to optimize the test suite during mutation analysis. · github.com, 9 Oct 2026
Performance option
The README describes an optional Cargo `muttest` profile with optimization level 3 and link-time optimization for mutation analysis dominated by mutant evaluation. · github.com, 4 Oct 2026
Purpose
muttest-rs is a Rust mutation testing tool for evaluating whether a test suite catches simulated bugs. · github.com, 9 Oct 2026
Release-code guidance
The README instructs users to ensure muttest does not affect release code. · github.com, 4 Oct 2026
Reports
The tool writes a JSON report to `target/muttest/report.json`. · github.com, 9 Oct 2026
Runtime mutation
The `#[mutate]` macro transforms selected source patterns and inserts hooks to enable mutations at runtime, allowing the code to be compiled once. · github.com, 4 Oct 2026
Test setup
For library tests, the README shows annotating code and test modules, then running `cargo muttest --lib`. · github.com, 9 Oct 2026
Unit test workflow
For library mutation analysis, the README directs users to annotate code and test modules, run `cargo muttest --lib`, and inspect `target/muttest/report.json`. · github.com, 4 Oct 2026

Where muttest-rs stands on Freedom251

Look at these too