원클릭으로
testing-gaps
// Run coverage, inspect results, and identify missing test scenarios for a given source file. Use when analysing test coverage or finding untested branches.
// Run coverage, inspect results, and identify missing test scenarios for a given source file. Use when analysing test coverage or finding untested branches.
Rust code style and conventions for Syncpack. Use when writing or modifying Rust code. Covers functional patterns, imports, naming, and quality standards.
Write tests for Syncpack using the TestBuilder pattern. Use when adding tests for commands, validation logic, or any new functionality. Covers TestBuilder API, assertion patterns, and common test scenarios.
Add new features to Syncpack including commands and validation logic. Use when implementing new CLI commands, adding InstanceState variants, or extending version group behaviour.
Add and update the documentation website for Syncpack. Use when making user-facing changes to the codebase.
Debug and fix bugs in Syncpack using scientific debugging methodology. Use when a test is failing, unexpected behaviour occurs, or investigating issues. Covers hypothesis-driven debugging and TDD-based fixes.
Put the answer first, then context and details follow. Use when writing documentation, tutorials, error messages, or any communication where readers need to decide quickly if something is relevant to them.
| name | testing-gaps |
| description | Run coverage, inspect results, and identify missing test scenarios for a given source file. Use when analysing test coverage or finding untested branches. |
Find untested branches and missing real-world test scenarios for a source file.
Use cargo llvm-cov with --text output (not --html) for parseable results.
# Full coverage, filtered to target file
cargo llvm-cov test --text \
--ignore-run-fail \
--ignore-filename-regex '(_test.rs|\/test\/)' \
2>/dev/null | sed -n '/TARGET_FILE\.rs:/,/^$/p'
Example for preferred_semver.rs:
cargo llvm-cov test --text \
--ignore-run-fail \
--ignore-filename-regex '(_test.rs|\/test\/)' \
2>/dev/null | sed -n '/preferred_semver\.rs:/,/^$/p'
The text format shows per-line execution counts:
42| 80| .and_then(|range| ...) # Hit 80 times
74| 0| Some(preferred) # Never hit
321| 0| instance.mark_conflict(...) # Never hit
count > 0 = coveredcount = 0 = uncovered branch^N annotations on sub-expressions show partial coverage within a line... | grep -E '^\s+\d+\|\s+0\|'
For each uncovered branch, determine:
if/else chain backward| Category | Action |
|---|---|
| Real-world scenario never tested | Write a test |
| Edge case in existing logic | Write a test |
| Defensive branch (unreachable) | Note but skip |
| Dead code | Consider removing |
Beyond line coverage, look for missing combinations:
highestSemver, never lowestSemver^), never others (>=, <=)Structure findings as:
just test # All tests
cargo test test_name -- --nocapture # Specific test
just coverage # Regenerate coverage report