Back to Commands

/add_mutation_testing

🧪Code & Analysis & Testing

Setup mutation testing for code quality

Quick Actions

Installation

Option A: Install using BWC CLI (Recommended)

Install and manage this command with a single command:

bwc add --command add-mutation-testing

Option B: Install as User Command (manual)

macOS/Linux:

cp add-mutation-testing.md ~/.claude/commands/

Windows:

copy add-mutation-testing.md %USERPROFILE%\.claude\commands\

Option C: Install as Project Command (manual)

macOS/Linux:

mkdir -p .claude/commands && cp add-mutation-testing.md .claude/commands/

Windows:

mkdir .claude\commands 2>nul && copy add-mutation-testing.md .claude\commands\

Note: After installation, restart Claude Code to load the new command.

Usage

Slash command:

/add_mutation_testing

Command Instructions


Add Mutation Testing


Setup mutation testing for code quality


Instructions


  • **Mutation Testing Strategy Analysis**
  • - Analyze current test suite coverage and quality

    - Identify critical code paths and business logic for mutation testing

    - Assess existing testing infrastructure and CI/CD integration points

    - Determine mutation testing scope and performance requirements

    - Plan mutation testing integration with existing quality gates


  • **Mutation Testing Tool Selection**
  • - Choose appropriate mutation testing framework:

    - **JavaScript/TypeScript**: Stryker, Mutode

    - **Java**: PIT (Pitest), Major

    - **C#**: Stryker.NET, VisualMutator

    - **Python**: mutmut, Cosmic Ray, MutPy

    - **Go**: go-mutesting, mut

    - **Rust**: mutagen, cargo-mutants

    - **PHP**: Infection

    - Consider factors: language support, performance, CI integration, reporting


  • **Mutation Testing Configuration**
  • - Install and configure mutation testing framework

    - Set up mutation testing configuration files and settings

    - Configure mutation operators and strategies

    - Set up file and directory inclusion/exclusion rules

    - Configure performance and timeout settings


  • **Mutation Operator Configuration**
  • - Configure arithmetic operator mutations (+, -, *, /, %)

    - Set up relational operator mutations (<, >, <=, >=, ==, !=)

    - Configure logical operator mutations (&&, ||, !)

    - Set up conditional boundary mutations (< to <=, > to >=)

    - Configure statement deletion and insertion mutations


  • **Test Execution and Performance**
  • - Configure mutation test execution strategy and parallelization

    - Set up incremental mutation testing for large codebases

    - Configure mutation testing timeouts and resource limits

    - Set up mutation test caching and optimization

    - Configure selective mutation testing for changed code


  • **Quality Metrics and Thresholds**
  • - Set up mutation score calculation and reporting

    - Configure mutation testing thresholds and quality gates

    - Set up mutation survival analysis and reporting

    - Configure test effectiveness metrics and tracking

    - Set up mutation testing trend analysis


  • **Integration with Testing Workflow**
  • - Integrate mutation testing with existing test suites

    - Configure mutation testing execution order and dependencies

    - Set up mutation testing in development and CI environments

    - Configure mutation testing result integration with test reports

    - Set up mutation testing feedback loops for developers


  • **CI/CD Pipeline Integration**
  • - Configure automated mutation testing in continuous integration

    - Set up mutation testing scheduling and triggers

    - Configure mutation testing result reporting and notifications

    - Set up mutation testing performance monitoring

    - Configure mutation testing deployment gates


  • **Result Analysis and Remediation**
  • - Set up mutation testing result analysis and visualization

    - Configure surviving mutant analysis and categorization

    - Set up test gap identification and remediation workflow

    - Configure mutation testing regression tracking

    - Set up automated test improvement recommendations


  • **Maintenance and Optimization**
  • - Create mutation testing maintenance and optimization procedures

    - Set up mutation testing configuration version control

    - Configure mutation testing performance optimization

    - Document mutation testing best practices and guidelines

    - Train team on mutation testing concepts and workflow

    - Set up mutation testing tool updates and maintenance