Engineering
mutation-testing avatar

mutation-testing

Validate test suite effectiveness using mutation testing to inject faults, measure kill rates, and identify weak test assertions.

Introduction

Mutation testing is an advanced quality engineering technique that evaluates the robustness of your test suite by programmatically modifying your source code—introducing 'mutants'—to see if your existing tests fail as expected. If a test suite passes despite these deliberate code regressions, the tests are considered weak or ineffective. This skill enables developers and QA engineers to move beyond simple line coverage metrics toward measuring actual bug-detection capability. By automating the lifecycle of mutation injection, test execution, and result analysis, it ensures that your application logic is protected by meaningful assertions rather than hollow coverage stats.

  • Automatically injects common mutation operators such as arithmetic changes, relational operator swaps, logical operator inversions, and statement removal.

  • Provides immediate feedback through mutation scores, allowing teams to set thresholds (e.g., >80%) for quality gates in CI/CD pipelines.

  • Integrates with the Stryker mutation framework for JavaScript/TypeScript projects, supporting Jest and other modern test runners.

  • Generates actionable diagnostics to pinpoint surviving mutants, providing direct insight into which lines of code or business logic are currently under-tested.

  • Facilitates test improvement by suggesting boundary value analysis and additional test cases to kill surviving mutants effectively.

  • Intended for use when evaluating test suite maturity, preparing for critical releases, or refactoring legacy codebases where test confidence is low.

  • Requires existing test suites (e.g., Jest, Vitest, Pytest) and a stable development environment.

  • Best utilized in conjunction with other AQE fleet skills like coverage-specialist for gap detection and qe-test-generator for automating the creation of missing assertions.

  • Performance note: mutation testing can be resource-intensive; it is recommended to focus execution on critical code paths (e.g., payment, authentication, data integrity) rather than the entire codebase simultaneously.

  • Keeps a running history of scores in .claude/skills/mutation-testing/run-history.json to track quality improvements over time.

  • Can be coordinated with the qe-queen-coordinator to form part of a holistic 'shift-left' testing strategy within automated pipelines.

Repository Stats

Stars
329
Forks
65
Open Issues
4
Language
TypeScript
Default Branch
main
Sync Status
Idle
Last Synced
Apr 29, 2026, 01:24 AM
View on GitHub