mutation-testing

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Mutation Testing — Campaign Configuration (mewt/muton)

变异测试 —— 活动配置(mewt/muton)

Note: muton and mewt share identical interfaces but target different languages — mewt for general-purpose languages (Rust, Solidity, Go, TypeScript, JavaScript), muton for TON smart contracts (Tact, Tolk, FunC). All examples use
mewt
commands, but they work exactly the same with
muton
. File names change accordingly:
mewt.toml
muton.toml
,
mewt.sqlite
muton.sqlite
.
注意:muton和mewt拥有完全相同的接口,但适配的编程语言不同——mewt适用于通用编程语言(Rust、Solidity、Go、TypeScript、JavaScript),muton适用于TON智能合约(Tact、Tolk、FunC)。所有示例均使用
mewt
命令,但换成
muton
也能完全正常运行。对应的文件名也需要修改:
mewt.toml
muton.toml
mewt.sqlite
muton.sqlite

When to Use

适用场景

Use this skill when the user:
  • Mentions "mewt", "muton", or "mutation testing"
  • Needs to configure or optimize a mutation testing campaign
  • Wants to run
    mewt run
    and needs help getting set up first
当用户存在以下需求时使用本技能:
  • 提到"mewt"、"muton"或"变异测试"
  • 需要配置或优化变异测试活动
  • 想要运行
    mewt run
    ,需要先完成环境配置准备

When NOT to Use

不适用场景

Do not use this skill when the user:
  • Wants to analyze or report on completed campaign results
  • Asks about tests or coverage without mentioning mutation testing

当用户存在以下需求时请勿使用本技能:
  • 想要分析已完成的测试活动结果或生成对应报告
  • 询问测试或覆盖率相关问题,但未提及变异测试

Quick Start

快速入门

Load workflows/configuration.md — a 5-phase guide from
mewt init
to a validated, ready-to-run campaign.
General question or unfamiliar command? Run
mewt --help
or
mewt <subcommand> --help
, then assist.

加载workflows/configuration.md——这是一份从
mewt init
到得到验证就绪、可直接运行的测试活动的5阶段指南。
有通用问题或是对命令不熟悉? 运行
mewt --help
mewt <subcommand> --help
,然后为用户提供协助。

Reference Index

参考索引

FileContent
workflows/configuration.md5-phase guide: init, scope, optimize, validate, run
references/optimization-strategies.mdPer-file targeting, two-phase campaigns, mutation type filtering

文件内容
workflows/configuration.md5阶段指南:初始化、范围划定、优化、验证、运行
references/optimization-strategies.md单文件目标设置、两阶段测试活动、变异类型过滤

Essential Commands

核心命令

bash
undefined
bash
undefined

Initialize and mutate

Initialize and mutate

mewt init # Create mewt.toml and mewt.sqlite mewt mutate [paths] # Generate mutants without running tests mewt run [paths] # Run the full campaign
mewt init # Create mewt.toml and mewt.sqlite mewt mutate [paths] # Generate mutants without running tests mewt run [paths] # Run the full campaign

Inspect configuration and scope

Inspect configuration and scope

mewt print config # View effective configuration mewt print targets # Table of all targeted files mewt print mutations --language [lang] # Available mutation types mewt status # Mutant count and per-file breakdown
mewt print config # View effective configuration mewt print targets # Table of all targeted files mewt print mutations --language [lang] # Available mutation types mewt status # Mutant count and per-file breakdown

Investigate specific mutants

Investigate specific mutants

mewt print mutants --target [path] # All mutants for a file mewt print mutants --severity high # Filter by severity mewt print mutant --id [id] # View mutated code diff mewt test --ids [ids] # Re-test specific mutants

---
mewt print mutants --target [path] # All mutants for a file mewt print mutants --severity high # Filter by severity mewt print mutant --id [id] # View mutated code diff mewt test --ids [ids] # Re-test specific mutants

---

What Results Mean

结果含义

  • Caught/TestFail: Tests detected the mutation (good)
  • Uncaught: Mutation survived — indicates untested logic
  • Timeout: Tests took too long, inconclusive
  • Skipped: A more severe mutant already failed on the same line
  • Caught/TestFail:测试检测到了变异(符合预期)
  • Uncaught:变异留存——说明存在未覆盖的逻辑
  • Timeout:测试运行超时,结果无定论
  • Skipped:同一行代码已有更严重的变异测试失败,该变异被跳过