本文へスキップ
Skillpedia
テスト75k · #2945

mutation-testing

できること

このスキルは、ミューテーションテストを設定し、確認します。ミューテーションテストは、コードに小さな変更を加えて、テストが失敗するかを見る方法です。重要なロジックのテストが強いかを知りたい開発者向けです。

使う場面

  • ✓テストが本当のバグを検出できるかを確認してほしいとき。
  • ✓カバレッジの数値は高いが、テストが意味のある結果を確認しているか疑わしいとき。
  • ✓ビジネスロジックの一つの重要なモジュールに絞って、テストを改善したいとき。

スキルのリンク

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/mutation-testing/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/mutation-testing/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“コードのテストカバレッジは高いのですが、本当のバグを検出できているか自信がありません。ミューテーションテストを設定してもらえますか。”

毎週5つの新しいスキル。1分で読めます。

仕組み

エージェントは、一つのモジュールを対象に Stryker を設定し、小さな変更を注入して実行します。テストが見逃した変更の一覧を示し、その変更を検出できるようテストを改善します。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

Use mutation testing to measure how well tests detect bugs

A codebase can have 90% line coverage and still ship critical bugs if tests only execute code without asserting meaningful outcomes. Mutation testing reveals these gaps by proving that your tests can distinguish correct code from subtly broken code — the standard that actually matters in production.

Quick Reference

  • Code coverage tells you which lines were executed; mutation score tells you which bugs were caught
  • Stryker injects small code changes (mutations) and checks whether tests fail — if they don't, the tests are weak
  • Aim for 80%+ mutation score on critical business logic paths
  • Run Stryker on a focused scope (one module) rather than the whole codebase to keep CI times manageable

Check

Assess whether this module has mutation testing configured and whether the mutation score on critical paths meets the project's quality threshold.

Fix

Set up Stryker for this module, run an initial mutation report, and improve tests to kill surviving mutants in the critical business logic paths.

Explain

Explain what mutation testing is, how Stryker works, and why mutation score is a more meaningful quality signal than code coverage alone.

Code Review

Review the Stryker configuration and mutation report to identify surviving mutants in critical code paths, and suggest test improvements to kill them.


For full implementation details, code examples, and framework-specific guidance, see references/rule.md.

Rule page: https://frontendchecklist.io/rules/testing/mutation-testing

よくある質問

ミューテーションスコアはカバレッジとどう違いますか?

カバレッジはどの行が実行されたかを示しますが、ミューテーションスコアはテストが実際にどのバグを検出したかを示します。

なぜ一度に一つのモジュールだけにするのですか?

CI の実行時間を管理しやすくするため、対象を絞ることを勧めています。

どのくらいのスコアを目指すべきですか?

重要なビジネスロジックの経路では、80パーセント以上を目指すよう提案しています。

詳細

作者による元の説明

Use when evaluating test quality on modules containing business logic, calculation utilities, or state machines to determine whether the tests provide genuine defect detection.

repo: thedaviddias/Front-End-Checklist

人気

GitHubのスター
75k
ランキング
#2945
ライセンス
MIT
更新日
2026/10/31

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル