# Check Coverage

> Analyze test coverage and identify untested code paths Use when this capability is needed.

- Skill: `tomevault-io/check-coverage-4` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add tomevault-io/check-coverage-4`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tomevault-io/check-coverage-4/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: tomevault-io (https://skillmd.com/u/tomevault-io)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/tomevault-io/check-coverage-4

---


# Check Coverage

Analyze test coverage and identify gaps.

## Workflow

### 1. Run Coverage (if available)

```bash
BASHUNIT_COVERAGE=true ./bashunit tests/
```

### 2. Map Functions to Tests

For each file in `src/`:

```bash
# List all public functions
grep "^function bashunit::" src/module.sh

# Find tests referencing each function
grep -r "function_name" tests/
```

### 3. Categorize Coverage

- **Well tested** — multiple tests, edge cases covered
- **Partially tested** — basic test exists, missing edge cases
- **Not tested** — no tests found

### 4. Identify Critical Gaps

**Priority 1:** Public API functions (`export -f`) with no tests
**Priority 2:** Error handling paths (`return 1`, `exit 1`) not tested
**Priority 3:** Complex conditionals without branch coverage

### 5. Generate Report

Output a markdown report with:
- Summary (total functions, tested count, estimated %)
- Coverage by module
- Critical gaps with file:line references
- Recommended tests to add (specific test function names)

## Coverage Goals

- 90%+ for public functions
- All user-facing CLI commands tested
- All error paths tested
- Internal helpers: optional (if trivial)

---
> Converted and distributed by [TomeVault](https://tomevault.io/claim/typeddevs) — claim your Tome and manage your conversions.
<!-- tomevault:4.0:skill_md:2026-04-11 -->

