jpskill.com
🛠️ 開発・MCP コミュニティ

mutation-testing

Evaluate test suite quality by introducing code mutations and verifying tests catch them. Use for mutation testing, test quality, mutant detection, Stryker, PITest, and test effectiveness analysis.

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o mutation-testing.zip https://jpskill.com/download/21479.zip && unzip -o mutation-testing.zip && rm mutation-testing.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/21479.zip -OutFile "$d\mutation-testing.zip"; Expand-Archive "$d\mutation-testing.zip" -DestinationPath $d -Force; ri "$d\mutation-testing.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して mutation-testing.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → mutation-testing フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-18
取得日時
2026-05-18
同梱ファイル
6

📖 Skill本文(日本語訳)

※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

[Skill 名] mutation-testing

ミューテーションテスト

目次

概要

ミューテーションテストは、ソースコードに小さな変更(ミューテーション)を導入し、テストが失敗することを確認することで、テストスイートの品質を評価します。テストがミューテーションを検出できない場合、それはテストカバレッジまたはテスト品質にギャップがあることを示します。この手法は、脆弱なテストや効果のないテストを特定するのに役立ちます。

使用する場面

  • テストスイートの有効性を評価する
  • テストされていないコードパスを見つける
  • テスト品質メトリクスを向上させる
  • 重要なビジネスロジックが十分にテストされていることを検証する
  • 冗長なテストや脆弱なテストを特定する
  • 行カバレッジを超えた実際のテストカバレッジを測定する
  • テストが実際に動作を検証していることを確認する

クイックスタート

最小限の動作例:

# Stryker をインストール
npm install --save-dev @stryker-mutator/core @stryker-mutator/jest-runner

# 設定を初期化
npx stryker init

# ミューテーションテストを実行
npx stryker run

リファレンスガイド

references/ ディレクトリ内の詳細な実装:

ガイド 内容
Stryker for JavaScript/TypeScript JavaScript/TypeScript 用 Stryker
PITest for Java Java 用 PITest
mutmut for Python Python 用 mutmut
Mutation Testing Reports ミューテーションテストレポート

ベストプラクティス

✅ DO

  • 重要なビジネスロジックをミューテーションテストの対象にする
  • 重要なコードでは 80% 以上のミューテーションスコアを目指す
  • 生き残ったミュータントをレビューしてテストを改善する
  • 同等なミュータントをマークして除外する
  • 重要なモジュールには CI でミューテーションテストを使用する
  • 境界条件を徹底的にテストする
  • コードの実行だけでなく、実際の動作を検証する

❌ DON'T

  • すべての場所で 100% のミューテーションスコアを期待する
  • すべてのコードでミューテーションテストを実行する(遅すぎる)
  • 同等なミュータントを無視する
  • ゲッター/セッターをミューテーションでテストする
  • 生成されたコードでミューテーションを実行する
  • 複雑なロジックのミューテーションテストをスキップする
  • 行カバレッジのみに焦点を当てる
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

Mutation Testing

Table of Contents

Overview

Mutation testing assesses test suite quality by introducing small changes (mutations) to source code and verifying that tests fail. If tests don't catch a mutation, it indicates gaps in test coverage or test quality. This technique helps identify weak or ineffective tests.

When to Use

  • Evaluating test suite effectiveness
  • Finding untested code paths
  • Improving test quality metrics
  • Validating critical business logic is well-tested
  • Identifying redundant or weak tests
  • Measuring real test coverage beyond line coverage
  • Ensuring tests actually verify behavior

Quick Start

Minimal working example:

# Install Stryker
npm install --save-dev @stryker-mutator/core @stryker-mutator/jest-runner

# Initialize configuration
npx stryker init

# Run mutation testing
npx stryker run

Reference Guides

Detailed implementations in the references/ directory:

Guide Contents
Stryker for JavaScript/TypeScript Stryker for JavaScript/TypeScript
PITest for Java PITest for Java
mutmut for Python mutmut for Python
Mutation Testing Reports Mutation Testing Reports

Best Practices

✅ DO

  • Target critical business logic for mutation testing
  • Aim for 80%+ mutation score on important code
  • Review survived mutants to improve tests
  • Mark equivalent mutants to exclude them
  • Use mutation testing in CI for critical modules
  • Test boundary conditions thoroughly
  • Verify actual behavior, not just code execution

❌ DON'T

  • Expect 100% mutation score everywhere
  • Run mutation testing on all code (too slow)
  • Ignore equivalent mutants
  • Test getters/setters with mutations
  • Run mutations on generated code
  • Skip mutation testing on complex logic
  • Focus only on line coverage

同梱ファイル

※ ZIPに含まれるファイル一覧。`SKILL.md` 本体に加え、参考資料・サンプル・スクリプトが入っている場合があります。