mutation-testing

Inject mutations into production code and report killed, survived, and no-coverage mutants.

710|89|Updated Nov 14, 2021
One-click install
npx skills add https://github.com/citypaul/.dotfiles --skill mutation-testing-citypaul
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: mutation-testing
Source: https://github.com/citypaul/.dotfiles/tree/main/claude/.claude/skills/mutation-testing
Command: npx skills add https://github.com/citypaul/.dotfiles --skill mutation-testing-citypaul

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Mutation testing answers whether tests would detect bugs by injecting small mutations into production code and verifying if tests catch them.

Core Features & Use Cases

  • Mutation testing generates and evaluates mutants to measure test effectiveness.
  • It helps identify weak tests, missing edge cases, and validation after refactors.
  • It supports branch analysis by validating tests for code changes.

Quick Start

Install or enable a mutation testing tool (e.g., Stryker for JavaScript/TypeScript). Then run the mutation testing workflow on your codebase to produce a report and view which mutants were killed, survived, or had no coverage.

Frequently Asked Questions about mutation-testing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
What is mutation testing and how does it measure test effectiveness?

Mutation testing measures test effectiveness by injecting small mutations into production code and verifying if the existing test suite catches the injected bugs. It generates mutants, runs tests against each, and reports killed, survived, or no-coverage outcomes.

How do I assess test strength after completing a TDD cycle?

To assess test strength after TDD, run a mutation testing workflow on your codebase. This process injects controlled mutations into production code and evaluates whether your test suite detects the changes, reporting survived mutants to identify weak tests.

Can mutation testing identify missing edge cases in branch code reviews?

Yes, mutation testing identifies missing edge cases during branch code reviews by injecting mutations into production code and evaluating mutant outcomes. It highlights scenarios where tests fail to kill mutants, guiding you to strengthen test coverage for specific branches.

How do I start validating my test suite with a tool like Stryker?

To start validating your test suite with a tool like Stryker, install the mutation testing tool in your JavaScript or TypeScript project. Run the mutation testing workflow to generate mutants, execute the test suite against them, and review the killed or survived metrics.

Why does high test coverage still miss bugs during refactoring?

High test coverage misses bugs during refactoring because coverage only measures code execution, not test assertions. Mutation testing solves this by injecting bugs into production code to verify if tests actually detect them, exposing weak tests that pass despite flawed logic.

What is the difference between mutation testing and standard test coverage metrics?

Standard test coverage measures which lines of code execute during tests, while mutation testing evaluates if tests actually detect bugs by injecting mutations into production code. Mutation testing provides killed, survived, and no-coverage metrics to reveal weak test assertions.