Skip to main content

Crate dev_mutate

Crate dev_mutate 

Source
Expand description

§dev-mutate

Mutation testing for Rust. Wraps cargo-mutants and emits results as dev_report::Report.

Mutation testing makes small deliberate changes to your code — flipping < to >, changing + to -, removing a return. It then runs your tests against each mutation. A test suite that catches the mutations kills them; surviving mutations are evidence the suite isn’t actually testing that behavior.

§Kill rate

kill_pct = killed / (killed + survived) * 100

Timeouts MUST NOT count toward either numerator or denominator — they don’t reflect test quality (REPS § 3).

§Quick example

use dev_mutate::{MutateRun, MutateThreshold};

let run = MutateRun::new("my-crate", "0.1.0");
let result = run.execute().unwrap();

let threshold = MutateThreshold::min_kill_pct(70.0);
let check = result.into_check_result(threshold);

§Requirements

cargo install cargo-mutants

The crate detects absence and surfaces MutateError::ToolNotInstalled without panicking.

Structs§

FileBreakdown
Per-file mutation outcome counts and derived kill rate.
MutateProducer
Producer adapter that drives a MutateRun and converts the result into a Report against the configured MutateThreshold.
MutateResult
Result of a mutation testing run.
MutateRun
Configuration for a mutation testing run.
SurvivingMutant
A surviving mutant — one the test suite did NOT catch.

Enums§

MutateError
Errors that can arise during a mutation testing run.
MutateThreshold
Threshold defining the minimum acceptable kill rate.