CheckOps home

Tools directory

P

CheckOps

proptest

proptest is a Hypothesis-inspired property-based testing framework for Rust, with composable strategies, automatic shrinking and persisted regression files.

Visit website

Latest public signals

Not refreshed yet. Refresh reads the public site and, when the entry has a GitHub repository, the latest release.

Visit Website

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

  1. Composable strategies: Build complex inputs from simple generators.
  2. Automatic shrinking: Minimal failing cases.
  3. Regression files: Failures are persisted and re-tested.
  4. Derive support: #[derive(Arbitrary)] for custom types.

Pros

  1. Free to use: Open source under the MIT or Apache-2.0 licence, so the core tool costs nothing to use.
  2. Actively maintained: The repository had commits as recent as 10 October 2026.

Cons

  1. Compile-time cost: Strategy-heavy tests can slow compilation.
  2. Learning curve: Strategies and combinators take practice.
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.

  1. Rust developers testing parsers, serialisation and algorithms.
  2. 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.