Mutation Testing

Mutation Testing

Guides an AI coding agent to evaluate test suite quality by introducing code mutations and checking tests catch them, using Stryker, PITest and mutmut.

Skill files7 files

references/

scripts/

templates/

SKILL.md80 lines
1
---
2
name: mutation-testing
3
description: >
4
Evaluate test suite quality by introducing code mutations and verifying tests
5
catch them. Use for mutation testing, test quality, mutant detection, Stryker,
6
PITest, and test effectiveness analysis.
7
---
8
9
# Mutation Testing
10
11
## Table of Contents
12
13
- [Overview](#overview)
14
- [When to Use](#when-to-use)
15
- [Quick Start](#quick-start)
16
- [Reference Guides](#reference-guides)
17
- [Best Practices](#best-practices)
18
19
## Overview
20
21
Mutation testing assesses test suite quality by introducing small changes (mutations) to source code and verifying that tests fail. If tests don't catch a mutation, it indicates gaps in test coverage or test quality. This technique helps identify weak or ineffective tests.
22
23
## When to Use
24
25
- Evaluating test suite effectiveness
26
- Finding untested code paths
27
- Improving test quality metrics
28
- Validating critical business logic is well-tested
29
- Identifying redundant or weak tests
30
- Measuring real test coverage beyond line coverage
31
- Ensuring tests actually verify behavior
32
33
## Quick Start
34
35
Minimal working example:
36
37
```bash
38
# Install Stryker
39
npm install --save-dev @stryker-mutator/core @stryker-mutator/jest-runner
40
41
# Initialize configuration
42
npx stryker init
43
44
# Run mutation testing
45
npx stryker run
46
```
47
48
## Reference Guides
49
50
Detailed implementations in the `references/` directory:
51
52
| Guide | Contents |
53
|---|---|
54
| [Stryker for JavaScript/TypeScript](references/stryker-for-javascripttypescript.md) | Stryker for JavaScript/TypeScript |
55
| [PITest for Java](references/pitest-for-java.md) | PITest for Java |
56
| [mutmut for Python](references/mutmut-for-python.md) | mutmut for Python |
57
| [Mutation Testing Reports](references/mutation-testing-reports.md) | Mutation Testing Reports |
58
59
## Best Practices
60
61
### ✅ DO
62
63
- Target critical business logic for mutation testing
64
- Aim for 80%+ mutation score on important code
65
- Review survived mutants to improve tests
66
- Mark equivalent mutants to exclude them
67
- Use mutation testing in CI for critical modules
68
- Test boundary conditions thoroughly
69
- Verify actual behavior, not just code execution
70
71
### ❌ DON'T
72
73
- Expect 100% mutation score everywhere
74
- Run mutation testing on all code (too slow)
75
- Ignore equivalent mutants
76
- Test getters/setters with mutations
77
- Run mutations on generated code
78
- Skip mutation testing on complex logic
79
- Focus only on line coverage
80

© AJ Geddes · MIT · source · posted by @OpenSourceBuffGuy on promptparty.com

@OpenSourceBuffGuy

I find openly licensed prompts and post them here.

0 followers · 13,409 prompts

More by @OpenSourceBuffGuy

See all
Swordswoman faces colossal robed figure in industrial yard prompt image

Swordswoman faces colossal robed figure in industrial yard

Writes a two-scene, 20-second live-action video prompt in which a swordswoman freezes a colossal figure with realistic ice and shatters him with a finishing slash.

video-prompt, seedance, action, martial-arts, visual-effects, multi-shot, cinematic, character-consistency, timed-beats, negative-prompt, guardrails, structured-output, photorealistic, fantasy-world, japan, camera-movement, slow-motion, blue-hour, widescreen, advanced, long-form, for-filmmakers, sound-effects, creatures, warriors

Overhead portrait of a girl lying in snow prompt image

Overhead portrait of a girl lying in snow

Creates an overhead portrait of a girl in a school blazer lying in fresh snow, using a JSON spec that keeps the reference face and sets camera, outfit and soft overcast light.

image-prompt, json-prompt, nano-banana, reference-image, face-reference, negative-prompt, photorealistic, portrait, woman, close-up, high-angle, winter, soft-lighting, natural-light, bokeh, moody, editorial, vertical-format, muted-colors, limited-palette, film-grain, cinematic, structured-output, for-photographers, for-artists

Morning skincare ritual ending on serum hero shot prompt image

Morning skincare ritual ending on serum hero shot

Produces a 15-second skincare commercial from an uploaded storyboard, with eight timed match-cut shots ending on a serum hero shot.

video-prompt, video-ad, product-video, multi-shot, timed-beats, scene-transitions, camera-movement, macro, reference-image, storyboard, character-consistency, skincare, beauty, advertising, photorealistic, cinematic, natural-light, woman, hailuo, tracking-shot, slow-motion, for-marketers, long-form

Reviews

Loading reviews…

Discussion

Loading comments…