test-gap-analysis
Performs pseudo-mutation analysis on production code in any language to find gaps in existing tests. Use when the user asks to find weak or shallow tests, discover untested edge cases, or check whether tests would catch a bug — e.g. \"would my tests catch it if someone changed the code\", \"would a subtle logic or boundary change slip past the current tests\", \"are my tests strong enough to catch a subtle bug\". Evaluates test effectiveness through mutation-style reasoning: analyzes mutation points (boundaries, boolean flips, null returns, exception removal, arithmetic changes) and checks whe
npx skills add dotnet/skills --skill test-gap-analysis --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
What it does
Analyze production code in any supported language by reasoning about hypothetical mutations, then confirm them against the real test suite to reveal blind spots where tests pass but would fail if code were broken. It uses language extensions to map concepts like null checks and error handling to the target language and identifies mutation points across boundaries, boolean logic, return values, exceptions, arithmetic, and null checks. It intentionally avoids running actual mutation testing tools and should not be used to write new tests.
How it works
- Detect language and load extension by calling the language-specific extension guidance file via the extension mechanism.
- Gather production code and test code pairs, establishing which tests exercise which production methods through call chains and setup helpers.
- Identify mutation points by examining production code and applying a mutation catalog that covers boundary, boolean/logic, return value, exception, arithmetic, and null-check mutations.
- Evaluate each mutation against tests by determining which tests cover the mutated line, whether assertions would detect the change, and classifying the mutation as Killed, Survived, No coverage, or Equivalent.
- If possible, verify survivors by running the test suite, applying each mutation, and re-running the relevant tests to confirm the outcome; otherwise report unverified (static reasoning).
- Calibrate findings with rules about not flagging trivial code, considering defensive depth, and avoiding false positives; and generate a structured report.
When to use it
- When asked whether user tests would catch a bug if code changes occur.
- To find weak or shallow tests and evaluate test effectiveness beyond coverage.
- When mutation analysis or mutation testing analysis is requested.
- As a pre-check step on freshly generated tests in a test-generation workflow.
What it can touch
The skill references and coordinates with language extensions and production/test code, and uses the mutation catalog to identify and annotate mutation points. It does not itself execute mutation testing tools within this description, and relies on test execution tools available in the environment when verification is possible.
Caveats
- Do not use for writing new tests or for detecting anti-patterns or measuring assertion diversity.
- Do not run actual mutation testing frameworks as part of this skill’s core workflow; if such tools are run, they should be treated as unverified steps and clearly labeled as such.
- If the suite cannot be built or run, findings are labeled unverified (static reasoning) and downgraded in confidence.
# Test Gap Analysis via Pseudo-Mutation Analyze production code in any supported language by reasoning about hypothetical mutations, then confirming them against the real test suite. This reveals blind spots where tests pass but would continue to pass even if the code were broken. > **Language-specific guidance**: Call the `test-analysis-extensions` skill to discover available extension files, then read the file matching the target codebase (e.g., `extensions/dotnet.md`, `extensions/python.md`, `extensions/typescript.md`). The extension file helps you find test files, recognize framework-specific assertion APIs, and identify language-specific null/None/nil patterns and error-handling idioms that map to the mutation catalog below. ## Why Pseudo-Mutation Matters 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
- Why Pseudo-Mutation Matters
- When to Use
- When Not to Use
- Inputs
- Workflow
- Step 1: Detect language and load extension
- Step 2: Gather production and test code
- Step 3: Identify mutation points
- Step 4: Evaluate each mutation against tests
- Step 4b: Verify every reported survivor by running the tests
- Step 5: Calibrate findings
- Step 6: Report findings
- Validation
- Common Pitfalls
What does the test-gap-analysis skill do?
Performs pseudo-mutation analysis on production code in any language to find gaps in existing tests. Use when the user asks to find weak or shallow tests, discover untested edge cases, or check whether tests would catch a bug — e.g. \"would my tests catch it if someone changed the code\", \"would a subtle logic or boundary change slip past the current tests\", \"are my tests strong enough to catch a subtle bug\". Evaluates test effectiveness through mutation-style reasoning: analyzes mutation points (boundaries, boolean flips, null returns, exception removal, arithmetic changes) and checks whe
How do I install it?
Run `npx skills add dotnet/skills --skill test-gap-analysis --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From dotnet/skills, a repository with 4,927 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
