Simulated Mutation Testing & Branch Coverage Verification
Audit test suites by simulating mutant bugs (flipped conditionals, off-by-one errors) to expose weak assertions.
Simulate code mutants (negating conditionals, swapping return values, removing boundary checks) to identify surviving mutants and strengthen weak assertions.
Execution Workflow Procedure
Ordered steps the coding agent executes when performing this skill.
Generate Realistic Code Mutants
Create 5-8 subtle mutations in the target code (e.g. changing > to >=, modifying arithmetic, returning default values).
Evaluate Test Suite Kill Rate
Check if the existing test suite fails (kills the mutant) or gives false confidence (mutant survives).
Deliver Hardened Test Cases
Write new, targeted unit tests that kill every surviving mutant and achieve 100% mutation score.
Agent Safety Guardrails & Anti-Hallucination Rules
- DO NOT rely on line coverage as proof of test quality; verify that assertions actually test behavior.
- DO NOT use vague toBeTruthy() or toBeDefined() assertions where exact value checks are possible.
Expected Output Format
Surviving mutant report and strengthened test cases.
Domain Verification Checks
Example Agent Invocations
Install / Configure This Skill
# Place in .cursorrules or create .cursor/rules/simulated-mutation-testing-verification.mdc # Trigger: Whenever you perform simulated mutation testing & branch coverage verification --- name: simulated-mutation-testing-verification description: Audit test quality by simulating code mutants to expose weak assertions and false confidence. version: 1.0.0 compatibility: [Cursor, Claude Code, Cline, Roo Code, Antigravity] --- # Simulated Mutation Testing & Branch Coverage Verification ## Objective Expose weak assertions in unit test suites by introducing realistic code mutations and providing tests to kill every surviving mutant. ## Workflow 1. **Mutant Generation**: Introduce conditional flips, off-by-one errors, and boundary changes. 2. **Kill Rate Analysis**: Identify which mutants pass undetected by existing unit tests. 3. **Test Hardening**: Write precise assertions that fail whenever logic is altered.
Need a quick one-time prompt for chat?
Try the Mutation Testing & Missing Branch Coverage Finder — a lightweight version designed for 1-click copying directly into Claude, ChatGPT, or Cursor chat.
SprintKit Workflow Integrations
Complementary tools and checklists to pair with this agent workflow.
Related Agent Skills
Explore related procedural workflows in this discipline.
Comprehensive Unit Test Suite Generation (AAA Pattern)
Generate mutation-tested unit tests with Arrange-Act-Assert structure, boundary cases, and proper mock boundaries.
Flaky CI Test & Async Timing Resolution
Fix nondeterministic test failures, unhandled async promises, and race conditions in Playwright, Jest, or Vitest.
Strict TypeScript Type Safety & Soundness Audit
Audit TypeScript code for type safety, type narrowing, generics, mutation traps, and runtime boundary validation.