SKILL

rust-testing

Rust testing patterns including unit tests, integration tests, async testing, property-based testing, mocking, and coverage. Follows TDD methodology.

Target: Software development & testing. Automatically collected · unverified.

Excerpt from the author’s documentation

Extracted from a fixed version of SKILL.md in its original language. This is the author’s documentation; installation, compatibility and runtime results have not been verified by this site.

Read the original English text

Topics in the source

  • Rust Testing Patterns
  • When to Use
  • How It Works
  • TDD Workflow for Rust
  • The RED-GREEN-REFACTOR Cycle
  • Step-by-Step TDD in Rust
  • Unit Tests
  • Module-Level Test Organization

Comprehensive Rust testing patterns for writing reliable, maintainable tests following TDD methodology. 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 1. Identify target code — Find the function, trait, or module to test 2. Write a test — Use #[test] in a #[cfg(test)] module, rstest for parameterized tests, or proptest for property-based tests 3. Mock dependencies — Use mockall to isolate the unit under test 4. Run tests (RED) — Verify the test fails with the expected error 5. Implement (GREEN) — Write minimal code to pass 6. Refactor — Improve while keeping tests green 7. Check coverage — Use cargo-llvm-cov, target 80%+ | Code Type | Target | |-----------|--------| | Critical business logic | 100% | | Public API | 90%+ | | General code | 80%+ | | Generated / FFI bindings | Exclude | DO: Write tests FIRST (TDD) Use #[cfg(test)] modules for unit tests Test behavior, not implementation Use descriptive test names that explain the scenario Prefer asserteq! over assert! for better error messages Use ? in te

This is an excerpt. Refer to the complete source and its current requirements.

Source repository
affaan-m/ECC
Source file
.kiro/skills/rust-testing/SKILL.md
Fixed revision
d2ef2680594f9a17526a6e1a2e18b3d242c5d17b
Read the complete original documentation ↗

Requirements

  • Only the author’s Skill metadata is included. Read the full instructions to check dependencies, licensing and conditions of use.

A small first task

先阅读原作者说明,再决定是否在自己的 AI 工具中使用。

Instructions for your AI tool

Author documentation is not live verification by this site. Without evidence, we do not mark a resource as compatible, safe or free.

Sources and evidence

This record was collected automatically. Its documentation, suitability and runtime behavior have not been manually verified.

Author: affaan-m/ECC · original repository metadata. Documentation review: Not reviewed. Last source check: 2026-11-09T14:01:48.670Z.

Categories are inferred from names, descriptions and paths. They do not establish compatibility.

License and attribution

MIT. Third-party content and copyright remain with their authors. Refer to the original license and terms.

Original license ↗

Synchronization, copying and user-reported success do not mark a resource as runtime-tested.

Limitations and notes

  • Collecting metadata does not mean this site has installed, adapted, runtime-tested or security-reviewed the resource.