agentleFS
takayoshitoyoda05takayoshitoyoda05/claude-ml-template/.claude/skills/mutation-test/SKILL.md

mutation-test

Skill1 starsChanged 2 months agoMITView on GitHub

テストの質を検証するとき、「ミューテーションテストして」「テストの質を確認して」と言われたときに使う。自動発火しない。

9 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use skill-eval and grill-me.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • SaluteYBSkill

    skill-eval

    Evaluate, tune, and regression-check AgentSkills. Use when creating a new skill or improving an existing one and you need structured should-trigger, should-not-trigger, boundary-case, and execution-quality examples. Also use when auditing overlapping skills and sharpening trigger descriptions before release.

    Also in 3 projects that use this

  • GoogleSkill

    grill-me

    A relentless interview to sharpen a plan or design.

    Also in 3 projects that use this

The file

Files
SKILL.md

ミューテーションテスト

コードに意図的な小変更(ミューテーション)を入れ、テストがそれを検出できるかを測る。 カバレッジが高くてもアサーションが浅いテストはミューテーションを見逃す。 「テストがあるから安心」の落とし穴を検出する。

いつ使うか

  • regression-suite や property-test で生成したテストの質を確認したいとき
  • 重要なモジュール(評価指標の計算、データ分割など)のテストが 本当に信頼できるか確認したいとき
  • テストカバレッジは高いのにバグが漏れる、と感じたとき

前提条件

  • pytest でテストが通る状態であること
  • mutmut がインストールされていること。無ければ「uv add --dev mutmut で 追加してよいか」をユーザーに確認してから導入する(依存とロックファイルが 変わるため、無断で追加しない)

進め方

  1. 対象モジュールを確認する(全体は時間がかかりすぎるため、 モジュール単位で実行する)。
  2. mutmut を実行する。
    uv run mutmut run --paths-to-mutate <対象モジュール>
  3. 結果を確認する。
    uv run mutmut results
  4. 生き残ったミュータント(survived)を1つずつ確認する。
    uv run mutmut show <ID>
  5. 以下の形式でレポートする。

レポート形式

ミューテーションテスト結果

  • 対象: <モジュール>
  • ミュータント総数: N
  • 検出(killed): N / 生存(survived): N / タイムアウト: N
  • ミューテーションスコア: XX%(killed / 総数)

生き残ったミュータント(テストの穴)

  • [ID] <ファイル:行> どんな変更が検出されなかったか → 追加すべきテスト観点: (具体的に)

判断の目安

  • スコア 80% 以上: テストの質は良好
  • スコア 60〜80%: 生存ミュータントを確認し、重要な箇所だけテストを補強
  • スコア 60% 未満: テストが浅い。アサーションの見直しを推奨

注意

  • このスキルはテストの追加提案までを行う。実際のテスト追加は ユーザーの承認を得てから行う(tdd または property-test スキルで)。
  • 実行時間が長い(モジュールあたり数分〜数十分)。全体への一括実行はしない。
  • 書き捨ての実験スクリプトには適用しない。

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.