testing-gaps

Identify uncovered branches and missing test scenarios from cargo llvm-cov coverage output.

2.1k|73|Updated Aug 17, 2017
One-click install
npx skills add https://github.com/JamieMason/syncpack --skill testing-gaps
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: testing-gaps
Source: https://github.com/JamieMason/syncpack/tree/main/.claude/skills/testing-gaps
Command: npx skills add https://github.com/JamieMason/syncpack --skill testing-gaps

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Rust projects can accumulate untested code paths that line-by-line review misses. This Skill runs coverage for a target source file, extracts uncovered branches, and classifies which gaps represent real-world scenarios worth testing versus defensive or dead code.

Core Features & Use Cases

  • Coverage Extraction: Runs cargo llvm-cov with text output filtered to a single target file, excluding test files from results.
  • Gap Classification: Categorizes each uncovered branch as a real-world scenario, edge case, defensive branch, or dead code with a recommended action.
  • Scenario Discovery: Detects missing combinations such as untested feature interactions, single-package-only tests, or untested semver range types.
  • Use Case: After adding a new semver resolution feature, run this Skill against preferred_semver.rs to find branches never exercised by the test suite and get a prioritized list of tests to write.

Quick Start

Analyze test coverage for src/preferred_semver.rs and report uncovered branches plus missing real-world test scenarios.

Frequently Asked Questions about testing-gaps

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I find uncovered branches in a Rust file?

Run cargo llvm-cov test with the --text flag and filter output to the target file using sed. Lines with an execution count of 0 indicate uncovered branches, which you can extract with grep for quick review.

How to use cargo llvm-cov for per-file coverage analysis?

Use cargo llvm-cov test --text with --ignore-filename-regex to exclude test files, then pipe through sed to isolate the section for your target file. The text format shows per-line execution counts that are easy to parse.

Should I use text or HTML output from cargo llvm-cov?

Use --text output when you need parseable, scriptable results for automated gap analysis. HTML reports are better for manual visual browsing but cannot be easily filtered or processed by command-line tools.

What should I do with uncovered defensive branches?

Classify each uncovered branch by tracing the code path that leads to it. Defensive or unreachable branches should be noted but skipped, while dead code should be considered for removal rather than tested.

Why does line coverage miss important test scenarios?

Line coverage only shows which statements executed, not which combinations were tested. Features tested individually may never be tested together, and tests may only exercise one semver range type or configuration option.