CheckOps
proptest
proptest is a Hypothesis-inspired property-based testing framework for Rust, with composable strategies, automatic shrinking and persisted regression files.
Latest public signals
Not refreshed yet. Refresh reads the public site and, when the entry has a GitHub repository, the latest release.
Introduction
proptest is a property testing framework for Rust, inspired by Python’s Hypothesis. It generates many inputs for a test, checks that a property holds, and when it finds a failure, shrinks the input to a minimal case that still fails.
Values come from strategies: built-in ones for primitive types and collections, regular-expression strategies for strings ("[a-z]{1,10}"), and combinators such as prop_map, prop_filter, prop_flat_map and prop_oneof! for complex data. The proptest! macro turns functions into property tests that run with cargo test, and #[derive(Arbitrary)] (via proptest-derive) generates strategies for your types. Failing cases are saved to proptest-regressions files so they are re-tested on every run, which prevents regressions. Configuration controls case counts, timeouts and forking. It is dual-licensed MIT or Apache-2.0, and the repository had commits in October 2026 (versions are published on crates.io; GitHub release data is out of date).
The source code is at proptest-rs/proptest on GitHub under the MIT or Apache-2.0 licence, with about 2,300 stars; the most recent commit was on 10 October 2026.
Features
- Composable strategies: Build complex inputs from simple generators.
- Automatic shrinking: Minimal failing cases.
- Regression files: Failures are persisted and re-tested.
- Derive support:
#[derive(Arbitrary)]for custom types.
Pros
- Free to use: Open source under the MIT or Apache-2.0 licence, so the core tool costs nothing to use.
- Actively maintained: The repository had commits as recent as 10 October 2026.
Cons
- Compile-time cost: Strategy-heavy tests can slow compilation.
- Learning curve: Strategies and combinators take practice.
Usage and Links (Example)
use proptest::prelude::*;
fn apply(price: u32, pct: u32) -> u32 { price - price * pct / 100 }
proptest! {
#[test]
fn discount_never_increases_price(price in 0u32..1_000_000, pct in 0u32..=100) {
prop_assert!(apply(price, pct) <= price);
}
#[test]
fn parse_roundtrip(s in "[a-z]{1,16}") {
prop_assert_eq!(parse(&format_id(&s)).unwrap(), s);
}
}
Resources:
Pricing
proptest is free and open source under the MIT or Apache-2.0 licence.
Recommended for?
- Rust developers testing parsers, serialisation and algorithms.
- Teams wanting regression-persisted property tests.
Conclusion
proptest is the most widely used property-based testing framework in Rust, with powerful strategies and reliable shrinking.
Alternatives
Other tools on CheckOps that cover similar ground. Open a page, or compare one with proptest side by side.
Rrstestrstest is an Apache-2.0 fixture-based and parameterised testing framework for Rust, offering pytest-style fixtures, #[case] tables, value matrices and async support on top of cargo test.Compare with proptest
Iinstainsta is an Apache-2.0 snapshot testing library for Rust by Armin Ronacher, with assert_snapshot! macros, serde-based formats, redactions, inline snapshots and the cargo insta review tool.Compare with proptest
Ccargo-nextestcargo-nextest is an Apache-2.0 next-generation test runner for Rust, up to 3x faster than cargo test per its site, with per-test process isolation, retries, partitioning, JUnit output and a filterset DSL.Compare with proptest
HHypothesisHypothesis is the MPL-2.0 property-based testing library for Python: describe the range of inputs, let it generate cases including edge cases, and get the simplest failing example when a property breaks.Compare with proptest
Ffast-checkfast-check is an MIT-licensed property-based testing framework for JavaScript and TypeScript, with rich arbitraries, shrinking, replayable seeds, model-based testing and race-condition detection.Compare with proptest
RRapidRapid is an MPL-2.0 property-based testing library for Go, inspired by Hypothesis, with automatic shrinking, state machine testing and integration with go test.Compare with proptest