| Crates.io | zk-mutant |
| lib.rs | zk-mutant |
| version | 0.1.1 |
| created_at | 2025-12-23 17:21:16.233756+00 |
| updated_at | 2026-01-08 17:15:50.956374+00 |
| description | Mutation testing for Noir circuits |
| homepage | https://www.mutorium.com |
| repository | https://github.com/mutorium/zk-mutant |
| max_upload_size | |
| id | 2001955 |
| size | 162,747 |
Mutation testing for Noir circuits.
zk-mutant runs your Noir test suite under small source-level mutations (for example == → !=, < → >=) to estimate how well your tests catch bugs. If a mutation survives, your tests didn’t notice a change that might represent a real defect.
Status: This is an early, fast-moving tool. The CLI surface, JSON formats, and output artifacts may evolve. Expect breaking changes before
1.0.0.
On run, zk-mutant:
Nargo.toml).nargo test (must pass before mutation testing starts).nargo test in a temporary project copy with the mutant applied../mutants.out, rotated to ./mutants.out.old).nargo available on your PATH (Noir toolchain)Tip: if your baseline nargo test fails due to a toolchain mismatch, zk-mutant can print the project's compiler_version (from Nargo.toml) and your nargo --version to help diagnose it.
git clone <REPO_URL>
cd zk-mutant
cargo install --path .
Once published:
cargo install zk-mutant
zk-mutant --help
Commands:
scan — project overview + mutation inventory summarypreflight — toolchain + baseline diagnostics (copy/paste friendly)list — list discovered mutants (no execution)run — run mutation testingFrom this repo (uses the included fixture):
cargo build
cargo test
zk-mutant scan --project tests/fixtures/simple_noir
zk-mutant run --project tests/fixtures/simple_noir
Run against your own Noir project:
zk-mutant preflight --project .
zk-mutant run --project .
Helpful flags:
--limit N — run only the first N mutants (deterministic order)-v / --verbose — print detailed per-mutant outcome lines--json — emit a machine-readable JSON report to stdout (human output stays on stderr)--fail-on-survivors — exit with code 2 if any mutants survive (CI-friendly)--out-dir PATH — write artifacts to a chosen directory (defaults to <project_root>/mutants.out)Example:
zk-mutant run --project . --limit 25 -v --fail-on-survivors
0 — success (and, if --fail-on-survivors is set, no survivors)1 — error (baseline failed, project load failed, etc.)2 — survivors found and --fail-on-survivors was setBy default, zk-mutant writes to <project_root>/mutants.out and rotates any existing directory to <project_root>/mutants.out.old.
Artifacts:
run.json — full run report (tool, version, baseline, summary, mutants, errors)mutants.json — discovered mutants (pre-limit)outcomes.json — compact outcomes list (IDs + spans + outcome + duration)caught.txt / missed.txt / unviable.txt — cargo-mutants-style outcome listsdiff/000001.diff — minimal snippet diffs for executed mutantslog — stable text log (no timestamps) with baseline + summary + errorzk-mutant aims to be deterministic:
1..N in that deterministic order.--limit truncates after ordering, so repeated runs are stable.Run unit + integration tests:
cargo test
Run CLI snapshot tests (insta):
cargo test --test cli_integration
cargo insta test
Run mutation testing against zk-mutant itself (meta!):
cargo mutants
MIT — see LICENSE.