Agent Skillstrailofbits/skills › mutation-testing

mutation-testing

GitHub

配置 mewt/muton 变异测试活动,分析存活突变体以识别等效突变或发现代码缺陷。涵盖设置、结果分析及报告生成,适用于提升测试覆盖率与质量保障。

plugins/mutation-testing/skills/mutation-testing/SKILL.md trailofbits/skills

Trigger Scenarios

提及 mewt, muton 或 mutation testing 配置变异测试活动 分析变异测试结果 通过变异测试寻找 bug

Install

npx skills add trailofbits/skills --skill mutation-testing -g -y
More Options

Non-standard path

npx skills add https://github.com/trailofbits/skills/tree/main/plugins/mutation-testing/skills/mutation-testing -g -y

Use without installing

npx skills use trailofbits/skills@mutation-testing

指定 Agent (Claude Code)

npx skills add trailofbits/skills --skill mutation-testing -a claude-code -g -y

安装 repo 全部 skill

npx skills add trailofbits/skills --all -g -y

预览 repo 内 skill

npx skills add trailofbits/skills --list

SKILL.md

Frontmatter
{
    "name": "mutation-testing",
    "description": "Configures mewt or muton campaigns, analyzes surviving mutants, and investigates bugs exposed by testing gaps. Use when setting up mutation testing, reviewing campaign results, identifying equivalent mutants, or finding bugs from surviving mutations.",
    "allowed-tools": "Read Write Bash Grep"
}

Mutation Testing (mewt/muton)

Routes to the right mutation testing workflow and loads the references that workflow needs.

Note: muton and mewt share identical interfaces. Examples use mewt; substitute muton and its file names (muton.toml, muton.sqlite) for muton projects.

mewt --help and mewt <subcommand> --help are the source of truth for command-line behavior. Examples below reflect the mewt 4.x API; run --help when a flag looks unfamiliar or a command fails.

When to Use

Use this skill when the user:

  • Mentions "mewt", "muton", or "mutation testing"
  • Wants to configure, scope, or speed up a mutation testing campaign
  • Wants to analyze mutation results — surviving/uncaught mutants, equivalent mutants, kill rate
  • Wants to use mutation results to find bugs in the source code

When NOT to Use

Do not use this skill when the user asks about tests or line coverage without any mutation testing context.


Routing

Pick the workflow, then load it together with the references listed for it. Workflows and references do not load each other — that decision belongs here.

Setting up, scoping, or speeding up a campaignworkflows/configuration.md → Also load references/optimization-strategies.md when the campaign estimate is long enough to need trimming, or the user asks to make it faster.

Campaign finished, hunting for bugs in untested codeworkflows/bug-hunter.md

Turning results into a formal analysis reportworkflows/analyzing-results.md, plus:

Anything else → run mewt --help or mewt <subcommand> --help, then assist directly.


Essential Commands

# Set up and run
mewt init                    # Create config and database
mewt mutate [paths]          # Generate mutants without testing them
mewt run [paths]             # Generate mutants and run the campaign

# Read results
mewt status                  # Overview with per-file breakdown
mewt results                 # Uncaught mutants (default view)
mewt results --all           # Every outcome, not just uncaught
mewt results --format json   # json | sarif | ids | table

# Narrow down (these filters work on both `results` and `print mutants`)
mewt results --target 'src/auth/**'   # Quote globs so the shell does not expand them
mewt results --severity high,medium
mewt results --mutation-types ER,CR
mewt results --status Uncaught        # Uncaught | TestFail | Skipped | Timeout
mewt results --line 42

# Investigate and re-test
mewt print mutant --id [id]              # View the mutated code
mewt test --ids [ids]                    # Re-test specific mutants
mewt test --ids-file uncaught_ids.txt    # Re-test IDs from a file, or '-' for stdin

# Inspect configuration
mewt print config                        # Effective config
mewt print targets                       # Files actually mutated
mewt print mutations --language [lang]   # Mutations and severities for a language

Language labels are canonical family or family/dialect values in mewt 4.x — for example rust, javascript/ts, move/sui, move/iota.


What Results Mean

  • Caught/TestFail: tests detected the mutation (good)
  • Uncaught: tests did not detect the change. Inspect the code to distinguish a testing gap from an equivalent mutation.
  • Timeout: tests took too long — inconclusive, not evidence of coverage
  • Skipped: a less severe mutant was skipped because a more severe mutant on the same line was uncaught

Interpreting Mutation Types

mewt print mutations --language [lang] lists every mutation slug, description, and severity for a language, and is authoritative — the operator set grows with each release. What that output does not tell you is what a survivor means, which is where prioritization comes from:

Severity Representative slugs What an uncaught mutant tells you
High ER (Error Replacement) Tests tolerate the injected error. Investigate whether the path executes, whether error handling masks the change, and whether assertions check the outcome.
Medium CR (Comment Replacement) Removing the statement does not fail the tests. Check whether its effects matter and whether assertions observe them.
Medium IF/IT (If False/True), NR (Negation Removal) Tests do not distinguish the changed condition. Both constant replacements surviving can indicate an unexecuted condition or weak assertions on the branch outcomes.
Low Operator shuffles (AOS, COS, LOS, BOS, shift/assignment variants), BL, AS, LC, WF Check boundary inputs, arithmetic assertions, and semantic equivalence. The mutation result alone does not establish whether the code executed.

Severity ranks the mutation, not the risk. A low-severity survivor in a fee calculation matters more than a high-severity survivor in a log line — weigh what the mutated code does. Filter with --severity to work through the results in priority order.

Version History

  • 32e34f8 Current 2026-09-22 22:49

    将变异分析和漏洞狩猎功能迁移至公共插件,扩展了结果分析与报告生成的工作流。

  • 9b28133 2026-08-20 09:17

Same Skill Collection

plugins/audit-context-building/skills/audit-context-building/SKILL.md
plugins/building-secure-contracts/skills/algorand-vulnerability-scanner/SKILL.md
plugins/building-secure-contracts/skills/cairo-vulnerability-scanner/SKILL.md
plugins/building-secure-contracts/skills/cosmos-vulnerability-scanner/SKILL.md
plugins/building-secure-contracts/skills/solana-vulnerability-scanner/SKILL.md
plugins/building-secure-contracts/skills/substrate-vulnerability-scanner/SKILL.md
plugins/building-secure-contracts/skills/ton-vulnerability-scanner/SKILL.md
plugins/burpsuite-project-parser/skills/burpsuite-project-parser/SKILL.md
plugins/c-review/skills/c-review/SKILL.md
plugins/claude-in-chrome-troubleshooting/skills/chrome-mcp-troubleshooting/SKILL.md
plugins/constant-time-analysis/skills/constant-time-analysis/SKILL.md
plugins/culture-index/skills/interpreting-culture-index/SKILL.md
plugins/devcontainer-setup/skills/devcontainer-setup/SKILL.md
plugins/differential-review/skills/differential-review/SKILL.md
plugins/dimensional-analysis/skills/dimensional-analysis/SKILL.md
plugins/dwarf-expert/skills/dwarf-expert/SKILL.md
plugins/firebase-apk-scanner/skills/firebase-apk-scanner/SKILL.md
plugins/fp-check/skills/fp-check/SKILL.md
plugins/gh-cli/skills/gh-cli/SKILL.md
plugins/git-cleanup/skills/git-cleanup/SKILL.md
plugins/goal-prompt/skills/goal-prompt/SKILL.md
plugins/let-fate-decide/skills/let-fate-decide/SKILL.md
plugins/modern-cpp/skills/modern-cpp/SKILL.md
plugins/modern-python/skills/modern-python/SKILL.md
plugins/open-sourcing/skills/open-sourcing/SKILL.md
plugins/post-patch-validation/skills/post-patch-validation/SKILL.md
plugins/review-walkthrough/skills/review-walkthrough/SKILL.md
plugins/rust-review/skills/rust-review/SKILL.md
plugins/second-opinion/skills/second-opinion/SKILL.md
plugins/semgrep-rule-creator/skills/semgrep-rule-creator/SKILL.md
plugins/semgrep-rule-variant-creator/skills/semgrep-rule-variant-creator/SKILL.md
plugins/sharp-edges/skills/sharp-edges/SKILL.md
plugins/skill-improver/skills/skill-improver/SKILL.md
plugins/spec-to-code-compliance/skills/spec-to-code-compliance/SKILL.md
plugins/static-analysis/skills/sarif-parsing/SKILL.md
plugins/supply-chain-risk-auditor/skills/supply-chain-risk-auditor/SKILL.md
plugins/testing-handbook-skills/skills/address-sanitizer/SKILL.md
plugins/testing-handbook-skills/skills/aflpp/SKILL.md
plugins/testing-handbook-skills/skills/atheris/SKILL.md
plugins/testing-handbook-skills/skills/cargo-fuzz/SKILL.md
plugins/testing-handbook-skills/skills/coverage-analysis/SKILL.md
plugins/testing-handbook-skills/skills/fuzzing-dictionary/SKILL.md
plugins/testing-handbook-skills/skills/fuzzing-obstacles/SKILL.md
plugins/testing-handbook-skills/skills/harness-writing/SKILL.md
plugins/testing-handbook-skills/skills/libafl/SKILL.md
plugins/testing-handbook-skills/skills/libfuzzer/SKILL.md
plugins/testing-handbook-skills/skills/ossfuzz/SKILL.md
plugins/testing-handbook-skills/skills/ruzzy/SKILL.md
plugins/testing-handbook-skills/skills/testing-handbook-generator/SKILL.md

Metadata

Files
0
Version
32e34f8
Hash
20e6ee2b
Indexed
2026-08-20 09:17

trang chủ - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-09-23 09:13
浙ICP备14020137号-1