Rust Testing
Rust testing patterns covering unit, integration, async, property-based, and mocked tests under a TDD workflow.
- CCM score
- 71 of 100
- skills.sh installs
- 14.8K
- GitHub stars
- 312.6K
- last updated
- Aug 21, 2026
Own this skill? Claim it
What it does
- Covers the RED-GREEN-REFACTOR cycle with worked examples for
#[test],#[cfg(test)]modules, and assertion macros - Includes patterns for
Resultand panic testing,tests/integration layouts, and#[tokio::test]async tests - Demonstrates
rstestparameterized cases and fixtures,proptestproperties with custom strategies, andmockalltrait mocks - Designed for Rust projects that want coverage checked with
cargo-llvm-covagainst an 80%+ target
Install
$ npx -y skills add affaan-m/ecc --skill rust-testing -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
Files
Rust Testing Patterns
Comprehensive Rust testing patterns for writing reliable, maintainable tests following TDD methodology.
When to Use
- Writing new Rust functions, methods, or traits
- Adding test coverage to existing code
- Creating benchmarks for performance-critical code
- Implementing property-based tests for input validation
- Following TDD workflow in Rust projects
How It Works
- Identify target code — Find the function, trait, or module to test
- Write a test — Use
#[test]in a#[cfg(test)]module, rstest for parameterized tests, or proptest for property-based tests - Mock dependencies — Use mockall to isolate the unit under test
- Run tests (RED) — Verify the test fails with the expected error
- Implement (GREEN) — Write minimal code to pass
- Refactor — Improve while keeping tests green
- Check coverage — Use cargo-llvm-cov, target 80%+
TDD Workflow for Rust
The RED-GREEN-REFACTOR Cycle
RED → Write a failing test first
GREEN → Write minimal code to pass the test
REFACTOR → Improve code while keeping tests green
REPEAT → Continue with next requirement
Step-by-Step TDD in Rust
Details
- Repository
- github.com/affaan-m/ecc
- Categories
- Rust, Testing & QA
- First seen
- Jul 14, 2026
Questions
What does the rust-testing skill help an agent do?
The rust-testing skill gives an agent Rust testing patterns for unit tests, integration tests, async tests, property-based testing, mocking, and coverage. It follows a TDD workflow with red, green, and refactor steps.
How do I install the rust-testing skill?
Run npx -y skills add affaan-m/ecc --skill rust-testing -y in your project to install it. Once installed, the agent can write Rust tests with proptest, mockall, and cargo-llvm-cov for coverage targets of 80% or more.
Where does rust-testing rank among Rust agent skills?
On the Rust category page on Claude Marketplaces, rust-testing ranks in the top 10. It sits alongside skills such as fix-errors, rust-best-practices, rust-async-patterns, rust-patterns, and memory-safety-patterns.
Does rust-testing cover async Rust code and mocking?
Yes, the skill includes async tests with Tokio using the tokio test attribute and timeouts. It also covers trait-based mocking with mockall, so units can be tested in isolation.
Who is rust-testing for?
It is for developers writing Rust functions, methods, or traits who want test coverage and a TDD workflow. It suits projects that need unit, integration, async, or property-based tests in Rust.
More from affaan-m/ecc
All 257- Prompt Optimizer14.5K
- Java Coding Standards14.5K
- Django Security14.4K
- Python Testing14.3K
- Laravel Security14.3K
- Android Clean Architecture14.3K
- Article Writing14.3K
- Cpp Coding Standards14.3K
- Springboot Security14.2K
- Liquid Glass Design14.2K
- Database Migrations14.1K
- E2e Testing14.1K
- Strategic Compact14K
- Laravel Patterns13.8K
- Verification Loop13.6K
- Codebase Onboarding13.6K
- Springboot Tdd13.4K
- Security Scan13.4K
- Django Tdd13.3K
- Deployment Patterns13.3K
- Search First13.3K
- Deep Research13.2K
- Eval Harness13.1K
- Continuous Learning13K
Similar to Rust Testing
More Rustpython-testingaffaan-m/ecc14.3K installsPytest testing patterns covering TDD, fixtures, parametrization, mocking, and coverage targets for Python projects.
cpp-testingaffaan-m/ecc13K installsTest-writing workflow for C++ with GoogleTest, GoogleMock, CMake, and CTest, including coverage and sanitizers.
rtk-tddrtk-ai/rtk2.4K installsEnforces Red-Green-Refactor TDD for Rust, with idiomatic test patterns and a strict pre-commit gate.
python-testing-patternswshobson/agents41.5K installsComprehensive pytest guide covering fixtures, mocking, parameterization, and test-driven development workflows for Python.
test-driven-developmentbobmatnyc/claude-mpm-skills412 installsLanguage-agnostic TDD guide covering red-green-refactor, test structure, mocking, and coverage targets for any stack.