Rust edition
mutastic for Rust: the docs
mutastic changes your code in small ways, such as >= to >, and runs your tests against each
change. A change no test notices is a gap: code your tests run but don’t check. For each one,
mutastic shows the inputs your tests used, the test that would close the gap, and the command that
proves it closed.
These pages are the Rust edition’s. They’re written to move into the Rust section of docs.mutastic.io once the site publishes more than one edition, so each page stands alone and links to the others by relative path.
Getting started
Section titled “Getting started”- Getting started: build mutastic, run it on a crate, read the first card, write the test, and prove it.
- Installing mutastic: the installer, building from source, and how a release is laid out.
- One command, two editions: which edition runs a project, a Rust crate inside a Gradle build, and the Java edition, fetched the first time it’s needed.
Concepts
Section titled “Concepts”- How a run works: one build for every mutant, switches, what happens to a mutant that doesn’t compile, one run split across CI jobs, and CI that fails only on new misses.
- Results and the score: caught, missed, timed out, not covered, skipped, and the crashes that prove nothing.
- Unsafe code: what’s left alone, what’s marked, and when to reach for Miri.
- Profiles: why overflow checks and debug assertions are always on.
- Mutant ids: what an id is made of, and what keeps it stable.
- Suggested tests: the test a card writes, and how its values are found by running your code.
- Output: each format, for people, coding agents and tools, and
explain. - Working through misses:
mutastic next, the missed mutants as a queue, one at a time, the one most worth a test first, and a baseline for older misses.
Operators
Section titled “Operators”- Operators: every operator, its set, its family, and its Java equivalent, in one table.
- A page for each family, in the Java edition’s order, each operator with the bug it stands for, an
example from a real run, the card it gives and the test that catches it:
conditions, arithmetic,
returns and errors, calls and writes,
arguments, library methods,
iterators,
OptionandResultand control flow.
Reference
Section titled “Reference”- Commands: each with every option it takes, and environment and exit codes.
- Report files:
mutation.jsonandmutation.html. - Events: the
--format=jsonlstream, and what the Rust edition adds to it. - Configuration:
mutastic.yaml, rules files, and ignoring one mutant. - Compatibility: what stays the same from one release to the next: ids, scores, commands and configuration, the events format, and the two editions’ versions.
- Troubleshooting: unviable mutants, slow runs, workspaces, and test code.
- Differences from the Java edition: only where you’d do something different.
How these pages stay true
Section titled “How these pages stay true”Every block of output on these pages is what mutastic printed on one of the repository’s
fixtures, kept in output/. cargo test runs each command again and fails while
mutastic prints anything else; MUTASTIC_DOCS_WRITE=1 cargo test --test docs writes the copies
again after a change to what it prints. Every Rust example is a fixture’s own code, quoted word for
word from a file the tests build, or a test a page adds: the getting-started page’s, which the same
test adds and runs, and each operator’s test that catches it, which are added to the operators
fixture together and must catch every mutant on the cards they follow. Every link between pages,
every command shown and every mutant id named is checked too.