mutation-testing

Measures test suite defect-detection strength by injecting code mutants with Stryker.

Updated Jun 24, 2026
One-click install
npx skills add https://github.com/Hakkadaikon/hymme --skill mutation-testing-hakkadaikon
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: mutation-testing
Source: https://github.com/Hakkadaikon/hymme/tree/main/skills/mutation-testing
Command: npx skills add https://github.com/Hakkadaikon/hymme --skill mutation-testing-hakkadaikon

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @stryker-mutator/core, vitest.

What problem does it solve? High code coverage does not guarantee that tests actually verify correctness—tests can execute every line while asserting nothing meaningful. This Skill measures the real defect-detection power of a test suite by injecting small faults (mutants) into the code and checking whether existing tests fail, exposing assertion gaps that coverage metrics hide. ## Core Features & Use Cases - Mutation Score Calculation: Injects mutants (e.g., flipping > to >=, + to -) and classifies results as Killed, Survived, No coverage, or Timeout to compute Mutation Score = Killed / (generated mutants − equivalent mutants). - Stryker Configuration for TypeScript: Provides a minimal stryker.config.json setup with the vitest test runner and per-test coverage analysis. - Assertion Gap Diagnosis: Identifies survived mutants as evidence of weak assertions (e.g., toBeGreaterThanOrEqual(0) instead of toBe(3)) and guides fixing them with strict value assertions. - Use Case: A module shows 100% C0/C1 coverage yet bugs keep leaking to production. Run Stryker on that critical module, find survived mutants, and tighten assertions until the mutation score reaches the target. ## Quick Start Ask the AI to evaluate the strength of your test suite using mutation testing with Stryker on your critical TypeScript modules and fix any survived mutants.

Frequently Asked Questions about mutation-testing

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

FAQPage Schema
How do I run mutation testing on a TypeScript project?

Install @stryker-mutator/core and create a stryker.config.json specifying your test runner (e.g., vitest), coverageAnalysis set to perTest, and a mutate glob for source files. Run Stryker to generate mutants and see which ones your tests kill.

What is a good mutation score for tests?

Mutation Score equals Killed divided by generated mutants minus equivalent mutants, and it reflects test strength better than coverage rate. Aim for a high target on critical modules, but never force 100% because equivalent mutants are impossible to kill by definition.

Mutation testing vs code coverage: what is the difference?

Coverage measures which lines or branches your tests executed, while mutation testing measures whether tests detect actual defects by breaking the code. High coverage with weak assertions still lets bugs through; mutation score exposes that gap directly.

Why do some mutants survive even with good tests?

Survived mutants usually indicate assertion gaps, such as checking toBeGreaterThanOrEqual(0) instead of fixing exact values with toBe. Some survivors are equivalent mutants that cannot change behavior and are impossible to kill, so they should be excluded from the score.

When should I not run mutation testing?

Avoid running it across the entire codebase in every CI job because cost scales with mutant count times test duration. Limit runs to critical modules or changed code, and schedule full runs for nightly CI instead.