rust-testing-verification

Run Rust testing workflows with proptest, cargo-fuzz, Criterion, and Miri.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/matthewharwood/engmanager_xyz --skill rust-testing-verification
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rust-testing-verification
Source: https://github.com/matthewharwood/engmanager_xyz/tree/main/.claude/skills/rust-testing-verification
Command: npx skills add https://github.com/matthewharwood/engmanager_xyz --skill rust-testing-verification

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill consolidates and guides rigorous Rust testing strategies to help you catch edge cases, ensure correctness, and measure performance. It combines property-based testing with proptest, fuzz testing with cargo-fuzz, benchmarking with Criterion, contract testing for traits, and Miri for undefined behavior detection.

Core Features & Use Cases

  • Property-Based Testing: Generate diverse inputs to uncover edge cases and invariants.
  • Fuzz Testing: Use cargo-fuzz to stress test parsers, encoders/decoders, and APIs.
  • Benchmarking: Benchmark critical paths with Criterion to quantify performance changes.
  • Contract Testing: Validate trait implementations and API contracts under varied scenarios.
  • Undefined Behavior Detection: Leverage Miri to catch UB in unsafe blocks.

Quick Start

Run the full Rust testing workflow on the current project: execute property-based tests with proptest, run fuzz tests with cargo-fuzz, and benchmark with Criterion; then report any failures and benchmark results.

Frequently Asked Questions about rust-testing-verification

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

FAQPage Schema
How do I set up property-based testing in Rust to catch edge cases?

Property-based testing with proptest generates diverse inputs automatically to uncover edge cases and invariants in your Rust code. Define properties your code must satisfy, and proptest finds counterexamples by running hundreds of randomized test cases against your implementation.

What's the difference between fuzzing and traditional unit tests in Rust?

Fuzzing with cargo-fuzz stresses your code with randomly mutated inputs over many iterations, excelling at discovering crashes and undefined behavior in parsers and APIs. Unit tests verify specific behaviors; fuzzing finds what breaks under unexpected input patterns.

How do I benchmark Rust code to measure performance changes?

Use Criterion to benchmark critical code paths with statistical rigor, generating detailed reports that quantify performance changes across runs. Criterion automates variance analysis so you catch real regressions, not noise.

Can I detect undefined behavior in my Rust unsafe code?

Miri interprets your Rust code to catch undefined behavior in unsafe blocks that regular compilation misses. Run your tests under Miri to validate memory safety assumptions before shipping.

How do I validate that my trait implementations meet their contract?

Contract testing applies varied inputs to trait implementations to verify they uphold their documented behavior. Combined with property-based testing, it ensures trait implementations remain consistent across different scenarios.

Do I need all five testing approaches, or can I use them selectively?

Each technique addresses different concerns: property-based testing finds invariant violations, fuzzing discovers crashes, benchmarking measures performance, contract testing validates traits, and Miri catches undefined behavior. Use the ones matching your correctness and performance requirements.