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) * 100Timeouts 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-mutantsThe crate detects absence and surfaces
MutateError::ToolNotInstalled without panicking.
Structs§
- File
Breakdown - Per-file mutation outcome counts and derived kill rate.
- Mutate
Producer Produceradapter that drives aMutateRunand converts the result into aReportagainst the configuredMutateThreshold.- Mutate
Result - Result of a mutation testing run.
- Mutate
Run - Configuration for a mutation testing run.
- Surviving
Mutant - A surviving mutant — one the test suite did NOT catch.
Enums§
- Mutate
Error - Errors that can arise during a mutation testing run.
- Mutate
Threshold - Threshold defining the minimum acceptable kill rate.