rust-testing-verification

Integrate proptest, cargo-fuzz, Criterion, contract testing and Miri for Rust code verification and benchmarking.

1|Updated Feb 15, 2026
One-click install
npx skills add https://github.com/tense-i/tslink --skill rust-testing-verification-tense-i
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rust-testing-verification
Source: https://github.com/tense-i/tslink/tree/main/skills/rust-testing-verification
Command: npx skills add https://github.com/tense-i/tslink --skill rust-testing-verification-tense-i

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill provides a comprehensive toolkit and strategies for ensuring the correctness, robustness, and performance of Rust code through advanced testing methodologies.

Core Features & Use Cases

  • Property-Based Testing: Automatically discover edge cases and verify invariants using proptest.
  • Fuzz Testing: Uncover bugs and security vulnerabilities with cargo-fuzz and structured fuzzing.
  • Benchmark Testing: Measure performance characteristics and identify regressions with Criterion.
  • Contract Testing: Ensure trait implementations adhere to their defined contracts.
  • Undefined Behavior Detection: Detect memory errors and UB with Miri.
  • Table-Driven Tests: Organize test cases for clarity and coverage.
  • Use Case: When developing a critical parsing library, use property-based testing to ensure it handles all valid and invalid inputs gracefully, fuzz testing to find unexpected crashes, and benchmarking to guarantee optimal performance.

Quick Start

Run all tests for the rust-testing-verification skill using the command cargo test.

Frequently Asked Questions about rust-testing-verification

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

FAQPage Schema
How do I find edge cases and verify invariants in Rust code?

Property-based testing in Rust automatically discovers edge cases by generating diverse inputs to verify code invariants. Using proptest, you define properties that must hold true across generated test cases rather than writing individual assertions.

How does Miri detect undefined behavior and memory errors in Rust?

Miri detects undefined behavior and memory errors in Rust by executing your code on an interpreter that checks for invalid memory access and violations of Rust's safety rules. It identifies bugs that the compiler cannot catch at compile time.

What is the best way to benchmark Rust code and identify performance regressions?

Benchmarking Rust code to identify performance regressions is best done with Criterion. It provides statistically rigorous performance measurements, allowing you to track optimizations and prevent regressions across code changes with detailed reports.

Can I use cargo-fuzz to uncover security vulnerabilities in Rust parsing libraries?

Yes, you can use cargo-fuzz to uncover security vulnerabilities in Rust parsing libraries. Fuzz testing feeds malformed or unexpected inputs to your code to trigger crashes and panics, revealing hidden security flaws and unexpected bugs.

How do I ensure Rust trait implementations adhere to their defined contracts?

Contract testing ensures Rust trait implementations adhere to their defined contracts by verifying that the implementations satisfy the behavioral requirements and invariants specified by the trait, preventing subtle logic errors in polymorphic code.

When do I need property-based testing versus table-driven tests in Rust?

Property-based testing is needed when you want to explore a vast input space to find unexpected edge cases, whereas table-driven tests in Rust are better for organizing specific, known input and output pairs for clear, targeted coverage.