Skip to content

paxosglobal/cargo-mutants

 
 

Repository files navigation

cargo-mutants

https://github.com/sourcefrog/cargo-mutants

Tests crates.io libs.rs GitHub Sponsors

cargo-mutants helps you improve your program's quality by finding places where bugs could be inserted without causing any tests to fail.

Coverage measurements can be helpful, but they really tell you what code is reached by a test, and not whether the test really checks anything about the behavior of the code. Mutation tests give different information, about whether the tests really check the code's behavior.

The goal of cargo-mutants is to be easy to run on any Rust source tree, and to tell you something interesting about areas where bugs might be lurking or the tests might be insufficient.

The main documentation is the user guide at https://mutants.rs/.

Install

cargo install --locked cargo-mutants

Quick start

From within a Rust source directory, just run

cargo mutants

To generate mutants in only one file:

cargo mutants -f src/something.rs

For more, see the user guide is at https://mutants.rs/.

Help advance cargo-mutants

If you use cargo-mutants or just like the idea you can help it get better:

Project status

As of October 2023 this is an actively-maintained spare time project. I expect to make releases about every one or two months.

It's very usable at it is and there's room for lots more future improvement, especially in adding new types of mutation.

Further reading

See also:

About

🧟 `cargo mutants` mutation testing for Rust

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 99.8%
  • Dockerfile 0.2%