Performs pseudo-mutation analysis on .NET production code to find gaps in existing test suites. Use when the user asks to find weak tests, discover untested edge cases, check if tests would catch a bug, or evaluate test effectiveness through mutation-style reasoning. Analyzes production code for mutation points (boundary conditions, boolean flips, null returns, exception removal, arithmetic changes) and checks whether existing tests would detect each mutation. Works with MSTest, xUnit, NUnit, and TUnit. DO NOT USE FOR: writing new tests (use writing-mstest-tests), detecting test anti-patterns (use test-anti-patterns), measuring assertion diversity (use assertion-quality), or running actual mutation testing tools.
Automate repetitive workflows and reduce manual effort
Example: Generate reports, summarize documents, draft communications
Save 3-5 hours per week on routine tasks
Learn new skills, understand complex topics, get expert guidance
Example: Explain concepts, provide examples, suggest learning resources
Accelerate learning and skill development by 2x
Enhance output quality through reviews, suggestions, and refinements
Example: Review drafts, suggest improvements, catch errors
Improve work quality by 30-40% with less effort
Time estimate: 15-45 minutes depending on use case complexity
Prerequisites
Submit your Claude Code skill and start earning
epx add dotnet/skills --skill test-gap-analysisCompatible with
Supported agents
| name | test-gap-analysis |
| description | "Performs pseudo-mutation analysis on .NET production code to find gaps in existing test suites. Use when the user asks to find weak tests, discover untested edge cases, check if tests would catch a bug, or evaluate test effectiveness through mutation-style reasoning. Analyzes production code for mutation points (boundary conditions, boolean flips, null returns, exception removal, arithmetic changes) and checks whether existing tests would detect each mutation. Works with MSTest, xUnit, NUnit, and TUnit. DO NOT USE FOR: writing new tests (use writing-mstest-tests), detecting test anti-patterns (use test-anti-patterns), measuring assertion diversity (use assertion-quality), or running actual mutation testing tools." |
| license | MIT |
Analyze .NET production code by reasoning about hypothetical mutations and checking whether existing tests would catch them. This reveals blind spots where tests pass but would continue to pass even if the code were broken.
Code coverage tells you what code ran during tests. It does not tell you whether tests would fail if that code were wrong. A method can have 100% line coverage but zero tests that would catch a sign flip, an off-by-one error, or a removed null check.
Pseudo-mutation analysis asks: "If I changed this line, would any test fail?" When the answer is "no," you've found a test gap.
| Coverage Metric | What It Measures | What It Misses |
|---|---|---|
| Line coverage | Which lines executed | Whether assertions verify those lines' behavior |
| Branch coverage | Which branches taken | Whether both branches produce different asserted outcomes |
| Mutation score | Whether tests detect code changes | Nothing — this is the gold standard |
This skill performs static pseudo-mutation — reasoning about mutations without actually running them — to approximate mutation testing at the speed of code review.
writing-mstest-tests)test-anti-patterns)assertion-quality)| Input | Required | Description |
|---|---|---|
| Production code | Yes | The source files to analyze for mutation points |
| Test code | Yes | The test files that cover the production code |
| Focus area | No | A specific mutation category or code region to focus on |
Read both the production code and its corresponding test files. If the user points to a directory, identify production/test pairs by convention (e.g., Calculator.cs tested by CalculatorTests.cs).
Establish which production methods are exercised by which test methods — trace this through method calls in test code, setup, and helper methods.
Scan the production code and annotate every location where a mutation could reveal a test gap. Use the mutation catalog below.
| Original | Mutation | What it tests |
|---|---|---|
< | <= | Off-by-one at upper bound |
> | >= | Off-by-one at lower bound |
<= | < | Boundary inclusion |
>= | > | Boundary inclusion |
== 0 | == 1 or <= 0 | Zero-boundary handling |
i < length | i < length - 1 or i <= length | Loop boundary |
index + 1 | index or index + 2 | Index arithmetic |
| Original | Mutation | What it tests |
|---|---|---|
&& | || | Condition independence |
|| | && | Condition necessity |
!condition | condition | Negation correctness |
if (x) | if (!x) | Branch selection |
true (constant) | false | Hardcoded assumption |
flag || other | other | Short-circuit first operand |
| Original | Mutation | What it tests |
|---|---|---|
return result | return null | Null handling downstream |
return result | return default | Default value handling |
return true | return false | Boolean return verification |
return list | return new List<T>() | Empty collection handling |
return count | return 0 or return count + 1 | Numeric return verification |
return string | return "" or return null | String return verification |
| Original | Mutation | What it tests |
|---|---|---|
throw new ArgumentNullException(...) | (remove entire throw) | Guard clause verification |
throw new InvalidOperationException(...) | (remove entire throw) | State validation testing |
if (x == null) throw ... | (remove entire guard) | Null guard testing |
if (!IsValid()) throw ... | (remove entire check) | Validation testing |
| Original | Mutation | What it tests |
|---|---|---|
a + b | a - b | Addition correctness |
a - b | a + b | Subtraction correctness |
a * b | a / b | Multiplication correctness |
a / b | a * b | Division correctness |
a % b | a / b | Modulo correctness |
x++ | x-- | Increment direction |
-value | value | Sign flip |
| Original | Mutation | What it tests |
|---|---|---|
if (x == null) return ... | (remove null check) | Null path coverage |
if (x != null) { ... } | (always enter block) | Null guard necessity |
x ?? defaultValue | x | Null coalescing coverage |
x?.Method() | x.Method() | Null-conditional coverage |
x! | x | Null-forgiving operator necessity |
For each identified mutation point, reason about whether existing tests would detect the change:
| Verdict | Meaning | Action |
|---|---|---|
| Killed | At least one test would fail if this mutation were applied | No action needed — tests are effective here |
| Survived | No test would fail — the mutation would go undetected | This is a test gap — recommend a test improvement |
| No coverage | No test exercises this code path at all | Worse than survived — the code is untested |
| Equivalent | The mutation produces identical behavior (e.g., x * 1 → x / 1) | Skip — not a real mutation |
Before reporting, apply these calibration rules:
return _name;), auto-properties, and boilerplate don't need mutation analysis. Focus on logic, conditions, calculations, and error handling.>= to > doesn't alter behavior because the == case is impossible given the domain, mark it Equivalent and skip.Present the analysis in this structure:
Summary — Overall mutation score and key findings:
| Metric | Value |
|---------------------|----------|
| Mutation points | 42 |
| Killed | 28 (67%) |
| Survived | 10 (24%) |
| No coverage | 2 (5%) |
| Equivalent (skipped) | 2 (5%) |
Survived Mutations (Test Gaps) — For each survived mutation, report:
Group by priority: high-risk survived mutations first (business logic, calculations, security checks), lower-risk last (logging, formatting).
No-Coverage Zones — Code paths that no test reaches at all. These are worse than survived mutations.
Killed Mutations (Strengths) — Briefly note areas where tests are effective. Highlight well-tested methods and strong assertion patterns. Don't enumerate every killed mutation — summarize.
Recommendations — Prioritized list:
| Pitfall | Solution |
|---|---|
| Analyzing trivial code | Skip auto-properties, simple getters, and boilerplate — focus on logic |
| Reporting equivalent mutations as gaps | If the mutation doesn't change behavior, it's not a gap — mark Equivalent |
| Ignoring call chains | A private helper called from a tested public method is reachable — trace the chain |
| Over-counting mutations in generated code | Skip auto-generated code, designer files, and migration files |
| Recommending a new test for every survived mutation | Multiple survived mutations in the same method often share a single missing test — recommend one test that kills several |
| Ignoring production context | A survived mutation in ToString() formatting is less important than one in CalculateTotal() — prioritize by business risk |
| Claiming 100% kill rate is required | Some mutations in low-risk code are acceptable to leave — acknowledge this in the report |
| Not considering integration with other skills | If gaps are found, mention that writing-mstest-tests can help write the missing tests, and test-anti-patterns can audit existing test quality |
AI-first code editor with Composer
Before installing skills in Cursor, ensure your development environment meets these requirements:
node --versiontest-gap-analysisExecute the skills CLI command in your project's root directory to begin installation:
epx add dotnet/skills --skill test-gap-analysisFetches test-gap-analysis from dotnet/skills and configures it for Cursor.
The CLI shows a list of agents. Use arrow keys and space to select Cursor:
Confirm successful installation by checking the skill directory location:
.cursor/skills/test-gap-analysis
Restart Cursor to activate test-gap-analysis. Access via /test-gap-analysisin your agent's command palette.
Learn more:View source on GitHubSkills CLI docsAbout CursorWhat are agent skills?
Steps
Common Pitfalls
✓ Do
✗ Don't
💡 Pro Tips
✓ Use when
Use when skill capabilities match your task, clear ROI on time saved, and you can validate outputs. Best for repetitive tasks, learning, and quality improvement.
✗ Avoid when
Avoid when task requires deep expertise you can't validate, involves sensitive decisions, or when learning process is more valuable than speed of completion.
code-testing-agent
dotnet/skills · dotnet-test · same repo
migrate-mstest-v1v2-to-v3
dotnet/skills · dotnet-test · same repo
dotnet-test-frameworks
dotnet/skills · dotnet-test · same repo
code-testing-extensions
dotnet/skills · dotnet-test · same repo
writing-mstest-tests
dotnet/skills · dotnet-test · same repo
analyzing-dotnet-performance
dotnet/skills · Productivity · same repo
Keeps context tight: test-gap-analysis is the kind of skill you can hand to a new teammate without a long onboarding doc.
Useful defaults in test-gap-analysis — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.
I recommend test-gap-analysis for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.
Registry listing for test-gap-analysis matched our evaluation — installs cleanly and behaves as described in the markdown.
Solid pick for teams standardizing on skills: test-gap-analysis is focused, and the summary matches what you get after install.
I recommend test-gap-analysis for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.
Useful defaults in test-gap-analysis — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.
test-gap-analysis has been reliable in day-to-day use. Documentation quality is above average for community skills.
test-gap-analysis is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.
Keeps context tight: test-gap-analysis is the kind of skill you can hand to a new teammate without a long onboarding doc.
showing 1-10 of 45