AgentSkillsCN

mutation-testing-generator

配置变异测试工具(如 Stryker),以评估测试质量。适用于已构建完备测试套件,且用户希望进一步检验测试覆盖度与质量时使用。

SKILL.md
--- frontmatter
name: mutation-testing-generator
description: Configures mutation testing (e.g. Stryker) to measure test quality. Use when test suite is in place and user wants to check test quality.

Mutation Testing Generator

When to Trigger

  • Test suite completion
  • "Check test quality"

What to Do

  1. Config: Add Stryker (or similar) config: mutator (TypeScript), test runner (Jest/Vitest), files to mutate (exclude *.test.ts).
  2. Thresholds: Set high/low/break for mutation score; document what they mean.
  3. Run: Generate report; explain that surviving mutations mean tests didn’t catch that change (weak test or redundant code).
  4. Focus: Suggest improving tests for frequently surviving mutations first.

Mutation testing is slow; run on subset or in nightly. Use for critical paths rather than entire codebase at first.