Skip to content
Back to skills

Mutation Testing

ASecurity

Use when investigating or fixing failed Mutation Testing workflow runs, triaging surviving mutants, timeouts, or equivalent-mutant exclusions, running focused local mutations with select-mutations.py or run-mutations.py, or replaying a mutation range. Not for ordinary local test selection, general Rust test-harness design, or unrelated CI workflow gating and releases (use ci-cd-patterns).

  • 3 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 3, 2026
developmentrustgotestinggit

Works with

  • cli

Security analysis

A100/100

Scanned December 3, 2026

npx -y skills add sneivandt/dotfiles --skill mutation-testing --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Mutation Testing?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Mutation Testing
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/sneivandt-mutation-testing/badge)](https://www.skillsdirectory.com/skills/sneivandt-mutation-testing)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: mutation-testing
description: >
  Use when investigating or fixing failed Mutation Testing workflow runs,
  triaging surviving mutants, timeouts, or equivalent-mutant exclusions,
  running focused local mutations with select-mutations.py or
  run-mutations.py, or replaying a mutation range. Not for ordinary local
  test selection, general Rust test-harness design, or unrelated CI workflow
  gating and releases (use ci-cd-patterns).
---

# Mutation Testing

Exact local commands live in
[Mutation testing](../../../docs/content/development/mutation-testing.md), and
the risk-based selection table for ordinary Rust work lives in
[Focused mutation testing](../../../docs/content/development/testing.md#focused-mutation-testing).

## Inspect a failed CI run

1. Find the run in [mutation.yml](../../../.github/workflows/mutation.yml)
   (`gh run list -w mutation.yml`) and download `mutation-summary` (plus
   `mutation-inputs` when `mutation-plan.json` is needed) into a temp directory
   before reading shard logs. The summary includes the `base -> head` range,
   counts, missing/failed shards, and `--exact` replay commands.
2. Fetch `rust-mutation-results-*` shard artifacts only when a shard timed out,
   crashed, or omitted details.

## Triage rules

- **`MISSED` real behavior**: assert the user/caller-observable outcome at the
  lowest layer (result plus side effect or preserved state).
- **`MISSED` equivalent mutant**: prefer simplifying redundant code; otherwise
  add a justified narrow regex to `LINUX_EXCLUSIONS` or `WINDOWS_EXCLUSIONS` in
  [run-mutations.py](../../../.github/workflows/scripts/run-mutations.py).
- **Cross-platform alignment**: keep `NATIVE_MODULES`, `LINUX_EXCLUSIONS`,
  `WINDOWS_FILES`, and `WINDOWS_PATTERN` aligned in `run-mutations.py` so Linux
  exclusions never silently drop Windows coverage.
- **`TIMEOUT`**: never treat a timeout as caught—fix slow/hanging tests or route
  blocking mutations to a bounded target in `FOCUSED` in `run-mutations.py`.

## Local replay pitfalls

- `run-mutations.py` runs `cargo mutants --in-place` on the native OS
  filesystem; keep the working tree clean before invoking it because an
  interrupted run can leave mutant edits in `git diff`, and copy any report you
  want to keep out of `cli/mutants.out` before starting another run.
- [select-mutations.py](../../../.github/workflows/scripts/select-mutations.py)
  selects inputs against committed `HEAD` (not uncommitted source edits). Pass
  the run's `ORIGINAL_BASE_SHA` (or `--all-source` when no passing baseline
  existed). Never replace `ORIGINAL_BASE_SHA` with a later commit for a
  test-only fix, and never count a zero-mutant run as evidence.
- Clean up generated `cli/mutants.diff`, `cli/mutation-plan.json`, and
  `cli/mutants.out*` that you created before committing.

## CI cadence

- Only a passing **scheduled** run on `main` advances the nightly baseline
  (`event=schedule&status=success`); manual dispatches verify a range without
  moving it.
- Iterate locally first. Dispatch `mutation.yml` with
  `mutation_base=<ORIGINAL_BASE_SHA>` only when remote or native Windows
  verification is needed (never replay on `ci.yml`), and monitor through
  **Mutation: Results** for zero survivors, timeouts, and shard errors.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.