proptest

Generate property-based tests for Rust applications using the proptest crate.

Updated Apr 3, 2026
One-click install
npx skills add https://github.com/strawgate/agent-skills --skill proptest-strawgate
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: proptest
Source: https://github.com/strawgate/agent-skills/tree/main/proptest
Command: npx skills add https://github.com/strawgate/agent-skills --skill proptest-strawgate

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires proptest, proptest-state-machine, bolero.

What problem does it solve?

This skill addresses the limitations of example-based unit testing by generating random inputs to uncover edge cases, panics, and logic errors that manual tests often miss.

Core Features & Use Cases

  • Strategy Design: Create custom input generators that target specific domain constraints and boundary conditions.
  • State Machine Testing: Validate complex stateful systems by generating sequences of operations and verifying invariants.
  • Oracle Testing: Compare implementation outputs against a reference model to ensure functional correctness.
  • Use Case: Use this to stress-test a custom parser or a complex stateful protocol by automatically generating thousands of valid and invalid input sequences to ensure the system never panics.

Quick Start

Use the proptest skill to generate a property-based test suite for the current module that verifies the roundtrip property of the encoding function.

Frequently Asked Questions about proptest

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

FAQPage Schema
How do I use property-based testing in Rust to find edge cases and panics?

Property-based testing in Rust generates randomized inputs to automatically uncover edge cases, panics, and logic errors that manual example-based tests often miss. You use the proptest crate to perform exhaustive verification and shrinking of failing test cases.

What is the best way to stress-test a stateful Rust protocol for logic errors?

The best way to stress-test a stateful Rust protocol is using state machine testing. This technique generates sequences of operations to validate complex stateful systems and verify invariants, ensuring the system never panics during invalid input sequences.

How do I create custom input generators for Rust property tests targeting boundary conditions?

You create custom input generators by designing strategies that target specific domain constraints and boundary conditions. This strategy design allows you to precisely control the randomized inputs generated during property-based testing.

Does property-based testing support oracle testing for complex Rust systems?

Yes, property-based testing supports oracle testing for complex Rust systems. Oracle testing compares your implementation outputs against a reference model to ensure functional correctness when handling automatically generated valid and invalid input sequences.

Do I need the proptest crate to perform exhaustive verification and shrinking in Rust?

Yes, you need to integrate the proptest crate to perform exhaustive verification and shrinking of failing test cases. This integration is required to generate the randomized inputs that identify edge cases and logic errors.