rust-testing

Implement Rust test suites with TDD, mocking, and coverage tracking.

Updated May 9, 2026
One-click install
npx skills add https://github.com/kk20300113-png/my-claude-skills --skill rust-testing-kk20300113-png
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rust-testing
Source: https://github.com/kk20300113-png/my-claude-skills/tree/main/rust-testing
Command: npx skills add https://github.com/kk20300113-png/my-claude-skills --skill rust-testing-kk20300113-png

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Rust developers often struggle to implement reliable, maintainable test suites that follow industry best practices, leading to flaky tests, low code coverage, and undetected bugs in production.

Core Features & Use Cases

  • TDD Workflow Support: Step-by-step guidance for the RED-GREEN-REFACTOR cycle tailored to Rust projects.
  • Full Test Pattern Coverage: Includes examples and instructions for unit tests, integration tests, async tests, property-based testing with proptest, and mocking with mockall.
  • Coverage & CI Integration: Provides setup steps for cargo-llvm-cov coverage tracking and GitHub Actions pipelines to enforce test quality standards.
  • Use Case: A Rust backend developer can use this skill to implement a complete test suite for a new API service, including mocked database interactions, async endpoint tests, and CI-enforced coverage thresholds.

Quick Start

Use the rust-testing skill to write a full set of unit and integration tests for your new Rust user authentication module following TDD best practices.

Frequently Asked Questions about rust-testing

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

FAQPage Schema
How do I set up Rust unit tests and integration tests following TDD best practices?

Rust testing with TDD follows the RED-GREEN-REFACTOR cycle to implement unit and integration tests. You write failing tests first, implement code to pass them, then refactor while maintaining test reliability and coverage.

What is the best way to mock dependencies in Rust async tests?

Mocking dependencies in Rust async tests uses the mockall crate to configure mock objects. You generate mocks for traits, set expectations on methods, and verify interactions to isolate async endpoints and database logic during testing.

How do I implement property-based testing in Rust using proptest?

Property-based testing in Rust uses proptest to generate arbitrary test inputs and validate code invariants. You define strategies for data generation and assertions that hold true across generated cases, catching edge cases missed by unit tests.

How do I track Rust test coverage and enforce it in a CI pipeline?

Coverage tracking in Rust uses cargo-llvm-cov to measure executed lines during tests. You integrate it into GitHub Actions pipelines to automate test validation and enforce coverage thresholds on every commit.

Does Rust testing support benchmarking with Criterion and error testing?

Rust testing supports benchmarking with Criterion to measure performance regressions and error testing to assert panics. You write benchmark functions to track execution times and use assertion macros to verify error handling behavior.