cargo-mutants
:zombie: Inject bugs and see if your tests catch them!
Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (15.4%) to scientific vocabulary
Keywords
Keywords from Contributors
Repository
:zombie: Inject bugs and see if your tests catch them!
Basic Info
- Host: GitHub
- Owner: sourcefrog
- License: mit
- Language: Rust
- Default Branch: main
- Homepage: https://mutants.rs/
- Size: 3.64 MB
Statistics
- Stars: 961
- Watchers: 6
- Forks: 33
- Open Issues: 85
- Releases: 59
Topics
Metadata Files
README.md
cargo-mutants
https://github.com/sourcefrog/cargo-mutants
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/.
Prerequisites
cargo-mutants can help on trees with non-flaky tests that run under cargo test or cargo nextest run.
Install
sh
cargo install --locked cargo-mutants
You can also install using cargo-binstall or from binaries attached to GitHub releases.
Quick start
From within a Rust source directory, just run
sh
cargo mutants
To generate mutants in only one file:
sh
cargo mutants -f src/something.rs
Integration with CI
The manual includes instructions and examples for automatically testing mutants in CI, including incremental testing of pull requests and full testing of the development branch.
Help advance cargo-mutants
If you use cargo-mutants or just like the idea you can help it get better:
- Post an experience report in GitHub discussions, saying whether it worked, failed, found interesting results, etc.
- Sponsor development
Project status
As of August 2025 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.
If you try it out on your project, I'd love to hear back in a github discussion whether it worked well or what could be better:
- Did it work on your tree? Did you need to set any options or do any debugging to get it working?
- Did it find meaningful gaps in testing? Where there too many false positives?
- What do you think would make it better or easier?
This software is provided as-is with no warranty of any kind.
Further reading
See also:
Owner
- Name: Martin Pool
- Login: sourcefrog
- Kind: user
- Company: @stripe
- Repositories: 31
- Profile: https://github.com/sourcefrog
GitHub Events
Total
- Create event: 114
- Release event: 13
- Issues event: 85
- Watch event: 355
- Delete event: 94
- Issue comment event: 132
- Push event: 225
- Pull request review comment event: 12
- Pull request review event: 17
- Pull request event: 90
- Fork event: 10
Last Year
- Create event: 114
- Release event: 13
- Issues event: 85
- Watch event: 355
- Delete event: 94
- Issue comment event: 132
- Push event: 225
- Pull request review comment event: 12
- Pull request review event: 17
- Pull request event: 90
- Fork event: 10
Committers
Last synced: 9 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Martin Pool | m****p@s****t | 1,552 |
| Daniel Lambert | d****0@g****m | 14 |
| Zane Duffield | d****e@g****m | 10 |
| Paolo Barbolini | p****i@m****t | 5 |
| ASuciuX | a****u@h****o | 4 |
| Kevin Matthes | 9****s | 3 |
| Oleksii Karpenko | a****o@y****m | 3 |
| Scott Godwin | s****s@g****m | 3 |
| dependabot[bot] | 4****] | 3 |
| Vincent Berthier | v****r@p****g | 2 |
| Naglis Jonaitis | n****s@m****g | 2 |
| Brooks J Rady | b****y@g****m | 2 |
| Denis Rangel | d****s@i****t | 1 |
| Bruno Garcia | b****c@g****m | 1 |
| Daniel Moka | m****e@g****m | 1 |
| Dmitry Rodionov | c****g@g****m | 1 |
| Johannes Marbach | n****b@m****g | 1 |
| Mark Wainwright | w****l@g****m | 1 |
| Tim Diekmann | 2****n | 1 |
| Tim Heaney | o****l@g****m | 1 |
| Yining | z****g@g****m | 1 |
| mbp-stripe | 8****e | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 240
- Total pull requests: 237
- Average time to close issues: 2 months
- Average time to close pull requests: 5 days
- Total issue authors: 40
- Total pull request authors: 26
- Average comments per issue: 1.51
- Average comments per pull request: 0.71
- Merged pull requests: 196
- Bot issues: 0
- Bot pull requests: 4
Past Year
- Issues: 64
- Pull requests: 74
- Average time to close issues: about 1 month
- Average time to close pull requests: 5 days
- Issue authors: 18
- Pull request authors: 9
- Average comments per issue: 1.0
- Average comments per pull request: 0.73
- Merged pull requests: 48
- Bot issues: 0
- Bot pull requests: 2
Top Authors
Issue Authors
- sourcefrog (166)
- ASuciuX (8)
- xd009642 (7)
- dmoka (5)
- kpreid (5)
- sandersaares (4)
- cehteh (3)
- zaneduffield (2)
- yurivict (2)
- mathstuf (2)
- eirnym (2)
- barafael (1)
- anees-sequoiaat (1)
- fence-sitter (1)
- autarch (1)
Pull Request Authors
- sourcefrog (283)
- paolobarbolini (9)
- kevinmatthes (7)
- zaneduffield (6)
- dependabot[bot] (5)
- danjl1100 (4)
- brunoerg (3)
- LizardWizzard (3)
- oylenshpeegul (2)
- nfrankel (2)
- cl3joly (2)
- psandana (2)
- naglis (2)
- sgodwincs (2)
- ASuciuX (2)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 3
-
Total downloads:
- cargo 795,259 total
- Total docker downloads: 18,688,465
-
Total dependent packages: 9
(may contain duplicates) -
Total dependent repositories: 15
(may contain duplicates) - Total versions: 111
- Total maintainers: 1
proxy.golang.org: github.com/sourcefrog/cargo-mutants
- Documentation: https://pkg.go.dev/github.com/sourcefrog/cargo-mutants#section-documentation
- License: mit
-
Latest release: v25.3.1+incompatible
published 6 months ago
Rankings
crates.io: mutants
Decorator attributes to be used with cargo-mutants
- Documentation: https://docs.rs/mutants/
- License: MIT
-
Latest release: 0.0.3
published over 4 years ago
Rankings
Maintainers (1)
crates.io: cargo-mutants
Inject bugs and see if your tests catch them
- Homepage: https://mutants.rs/
- Documentation: https://docs.rs/cargo-mutants/
- License: MIT
-
Latest release: 25.3.1
published 6 months ago
Rankings
Maintainers (1)
Dependencies
- actions/checkout v3 composite
- actions/configure-pages v2 composite
- actions/deploy-pages v1 composite
- actions/upload-pages-artifact v1 composite
- Swatinem/rust-cache v2 composite
- Swatinem/rust-cache v2 composite
- actions-rs/toolchain v1 composite
- actions/checkout v3 composite
- Swatinem/rust-cache v2 composite
- actions/checkout v3 composite
- actions/upload-artifact v3 composite
- actions/checkout ec3a7ce113134d7a93b817d10a8272cb61118579 composite
- actions/upload-artifact 82c141cc518b40d92cc801eee768e7aafc9c2fa2 composite
- github/codeql-action/upload-sarif 5f532563584d71fdef14ee64d17bafb34f751ce5 composite
- ossf/scorecard-action c8416b0b2bf627c349ca92fc8e3de51a64b005cf composite
- Swatinem/rust-cache v2 composite
- actions/checkout v3 composite
- 148 dependencies
- assert_cmd 2.0 development
- insta 1.12 development
- lazy_static 1.4 development
- predicates 2 development
- pretty_assertions 1 development
- regex 1.5 development
- walkdir 2.3 development
- anyhow 1.0
- camino 1.0
- cargo_metadata 0.15
- clap 4
- clap_complete 4
- console 0.15
- cp_r 0.5.1
- ctrlc 3.2.1
- fs2 0.4
- globset 0.4.8
- itertools 0.10
- mutants 0.0.3
- nix 0.26
- nutmeg 0.1.2
- path-slash 0.2
- proc-macro2 1.0.29
- quote 1.0
- rand 0.8
- regex 1.5
- serde 1
- serde_json 1
- similar 2.0
- subprocess 0.2.8
- syn 1
- tempfile 3.2
- time 0.3
- toml 0.5
- tracing 0.1
- tracing-appender 0.2
- tracing-subscriber 0.3
- whoami 1.2
- mcr.microsoft.com/vscode/devcontainers/rust 0-${VARIANT} build