Code Monkey home page Code Monkey logo

cargo-mutants's Introduction

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/.

Prerequisites

cargo-mutants can help on trees with non-flaky tests that run under cargo test or cargo nextest run.

Install

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

cargo mutants

To generate mutants in only one file:

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:

Project status

As of January 2024 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.

This software is provided as-is with no warranty of any kind.

Further reading

See also:

cargo-mutants's People

Contributors

sourcefrog avatar asuciux avatar kevinmatthes avatar sgodwincs avatar thelostlambda avatar dependabot[bot] avatar dmoka avatar lizardwizzard avatar johennes avatar wainwrightmark avatar timdiekmann avatar yining avatar mbp-stripe avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.