Skip to content
Skill Authoring
Skill

/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.

From plugin
useful-ai-prompts
309200 skills
Install
$ npx -y skills add aj-geddes/useful-ai-prompts --skill mutation-testing --agent claude-code

How it fires

How this skill gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.
  • Slash command/mutation-testing

Context preview

The summary Claude sees to decide when to auto-load this skill.

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.

SKILL.md

mutation-testing.SKILL.md
name: mutation-testing
description: >
  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.

Mutation Testing

Table of Contents

  • [Overview](#overview)
  • [When to Use](#when-to-use)
  • [Quick Start](#quick-start)
  • [Reference Guides](#reference-guides)
  • [Best Practices](#best-practices)

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](references/stryker-for-javascripttypescript.md) | Stryker for JavaScript/TypeScript | | [PITest for Java](references/pitest-for-java.md) | PITest for Java | | [mutmut for Python](references/mutmut-for-python.md) | mutmut for Python | | [Mutation Testing Reports](references/mutation-testing-reports.md) | 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
Read more
Ships withuseful-ai-prompts

488 production-ready AI prompts, all following a standardized template with validated quality gates. Transform ChatGPT, Claude, and other AI assistants into expert consultants.

Get the whole plugin