mutation-testing
できること
このスキルは、ミューテーションテストを設定し、確認します。ミューテーションテストは、コードに小さな変更を加えて、テストが失敗するかを見る方法です。重要なロジックのテストが強いかを知りたい開発者向けです。
使う場面
- ✓テストが本当のバグを検出できるかを確認してほしいとき。
- ✓カバレッジの数値は高いが、テストが意味のある結果を確認しているか疑わしいとき。
- ✓ビジネスロジックの一つの重要なモジュールに絞って、テストを改善したいとき。
スキルのリンク
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/mutation-testing/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
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.
人気
- GitHubのスター
- 75k
- ランキング
- #2945
- ライセンス
- MIT
- 更新日
- 2026/10/31
コメント
- …
このリポジトリの他のスキル
frontendchecklist
75kコマンドラインツールを使って、フロントエンドのコードとライブページを、アクセシビリティ、速度、SEO、セキュリティに関する380以上のルールと照らし合わせて確認します。
frontend-checklist-global
75kフロントエンドのプロジェクトを、386のFront-End Checklistのルールすべてと照らし合わせて監査し、見つかった問題ごとに具体的な修正方法を示します。
404-page
75k見つからないページの画面に役立つリンクがあり、本物の404ステータスを返すかを確認し、迷った訪問者が目的のページを見つけられるようにします。
about-page
75kサイトの運営者が誰かを説明する、分かりやすいAboutページがあるかを確認し、訪問者と検索エンジンからの信頼を高めます。
似ているスキル
test-driven-development
311k機能や修正を作る前に、まず失敗するテストを書き、それが失敗するのを確認してから、合格させる最小のコードを書くようエージェントに教えます。
verification-before-completion
311kタスク、修正、ビルドが完了した、または合格したと主張する前に、実際のチェックを実行し、その出力を読むようエージェントに教えます。
migrate-to-shoehorn
310kテストファイル内の危険な型キャストを、shoehornライブラリに置き換え、テストが部分的なデータを使いつつ型チェックを通るようにします。