# Improve Rust Test Coverage

Missing tests leave Rust error paths and edge cases unprotected. This skill reviews code and tests, then suggests targeted coverage improvements.

## Install

```bash
npx skillstore add emillindfors/test-coverage-advisor
```

## Metadata

- Status: approved
- Slug: emillindfors-test-coverage-advisor
- Version: 1.0.0
- Author version: 1.0.0
- Skillstore revision: r1
- Version status: valid
- Tree hash: 7fafc2cee15f21d92ebe3df599315b7dd7d1a026b719701d226ba3fdcf2f84f4
- Author: EmilLindfors
- GitHub username: EmilLindfors
- License: MIT
- Repository: https://github.com/EmilLindfors/claude-marketplace/tree/main/plugins/rust-testing/skills/test-coverage-advisor
- Ref: a06681402992ceae98ba04d54cfd4ab004862696
- Supported tools: Claude, Codex, Claude Code
- Audit status: complete
- Agent install advisory: allowed
- Manual install advisory: allowed
- Artifact signature: available
- Audit attestation: unavailable
- Human verification: not\_verified
- Risk factors: external\_commands
- Quality score: 81
- Quality tier: silver
- Public page: https://skillstore.pages.dev/skills/emillindfors-test-coverage-advisor
- Manifest: https://skillstore.pages.dev/api/skills/emillindfors-test-coverage-advisor/manifest

## Capabilities

- Reviews Rust functions for missing success, error, and boundary tests.
- Suggests test cases for Result errors, async functions, and empty input.
- Recommends table-driven tests when similar cases repeat.
- Flags testing anti-patterns such as missing assertions or implementation-detail tests.
- Suggests coverage tools such as cargo-tarpaulin and cargo-llvm-cov.

## Use Cases

- Add Tests for New Rust Code: Identify missing success, failure, and boundary tests before a feature is merged.
- Review Pull Request Coverage: Check whether a change includes enough tests for error paths and edge cases.
- Plan Regression Coverage: Turn bug reports or risky behavior into focused regression test ideas.

## Prompt Templates

### Find Basic Coverage Gaps

```
Review this Rust function and suggest missing success, error, and edge case tests: [paste code].
```

### Improve an Existing Test Module

```
Review this Rust test module. Identify missing assertions, error paths, and opportunities for table-driven tests: [paste tests].
```

### Design Coverage for Async Code

```
Analyze this async Rust API and propose tests for success, failure, timeout, and not-found behavior: [paste code].
```

### Create a Coverage Review Plan

```
Assess this feature implementation and tests. Prioritize the highest-risk missing cases and explain why each test matters: [paste files or summary].
```

## Limitations

- Focuses on Rust examples and may need adaptation for other languages.
- Does not run tests, compute coverage metrics, or inspect runtime behavior.
- Cannot verify business intent without project context from the user.
- Offers guidance only; developers must implement and validate tests.

## Best Practices

- Share the smallest relevant function or test module so suggestions are specific.
- Include expected error types and business rules when asking for coverage advice.
- Ask for prioritized gaps when a feature has many possible edge cases.

## Anti Patterns

- Using the skill as a substitute for running test and coverage tools.
- Asking for broad coverage advice without showing code or behavior rules.
- Accepting generated test ideas without checking domain correctness.

## Security Audit

- Audited at: 2026-07-06T15:29:02.423\+00:00
- Summary: The static command findings are false positives caused by Markdown code fences in Rust and bash examples, not executable code. The blocker findings are sample email addresses in a table-driven test example. I found no evidence of prompt injection, data exfiltration, unauthorized network use, or tool instructions beyond Read/Grep/Glob.

## Stats

- Views: 226
- Downloads: 9
- Favorites: 0
- Popularity score: 0
