Proptest

Hypothesis-inspired property testing for Rust with automatic shrinking to minimal failing cases.

Library
Cargo
v1.11.0
2,215stars
MIT OR Apache-2.0

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
64/100Good
Development Activity52
Maintenance36
Community68
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
83/100Excellent
Architecture88
Code Quality88
Innovation86
Learning Curve68

Proptest is a property-based testing framework for Rust in the QuickCheck family, inspired by Python’s Hypothesis. Rather than writing example-based tests, you assert that properties of your code hold for arbitrary generated inputs; when Proptest finds a counterexample, it automatically shrinks it to the minimal case that still reproduces the failure.

Unlike classic QuickCheck, Proptest defines value generation and shrinking on a per-value ‘strategy’ basis rather than per type, which makes composing complex input generators far more flexible. It ships strategies for primitives, collections, strings (including regex-driven generation), and custom types, plus a macro-based DSL for writing tests concisely.

What You Get

  • The proptest! macro DSL for concise property tests
  • A rich library of strategies for primitives, collections, and strings
  • Automatic shrinking of counterexamples to minimal reproductions
  • Regex-based and custom value generation via composable strategies
  • Failure persistence so discovered cases are re-checked over time

Common Use Cases

  • Verifying invariants and round-trip properties (encode/decode, serialize/deserialize)
  • Fuzzing parsers and data structures with structured random input
  • Finding edge cases that example-based unit tests miss
  • Generating complex, valid test data via composed strategies

Under The Hood

Architecture - The core proptest crate is organized by the values it can generate: num.rs, bool.rs, char.rs, string.rs, collection.rs, tuple.rs, option.rs, and result.rs each define strategies, unified by the strategy/ module’s Strategy trait and combinators. The test_runner/ drives execution — sampling from strategies, detecting failures, and orchestrating shrinking — while sugar.rs/macros.rs provide the proptest! DSL and arbitrary/ supplies default strategies per type. Companion workspace crates (proptest-derive, proptest-macro, proptest-state-machine) layer derivation and stateful testing on top.

Tech Stack - Pure Rust (edition-modern, MSRV 1.86), structured as a Cargo workspace. It leans on small focused dependencies (e.g. bit-set, bit-vec, regex tooling for string generation) and supports no_std-style facades via std_facade.rs.

Code Quality - Proptest is a mature, feature-complete framework under active maintenance, with an extensive book, a detailed CHANGELOG, prerelease check scripts, and a Nix flake for reproducible builds. The per-value strategy design keeps generation and shrinking logic cohesive, and the codebase is broadly used and battle-tested across the Rust ecosystem.

API Design - The API is a strong point: the proptest! macro reads almost like a plain test while strategies compose fluently through combinators like prop_map, prop_filter, and prop_flat_map. The comprehensive book and per-value model make intermediate use approachable, though mastering custom strategies and shrinking behavior carries a moderate learning curve.

Used by 5 apps in this directory

Python
80%
Apache 2.0

headroom

AI Development · Developer Tools

66,835

Compress everything your AI agent reads — tool outputs, logs, RAG chunks, and files — before it reaches the LLM, achieving 60–95% fewer tokens with the same answers.

View details
84
Repo Health
86
Technical
73
Dependency
Built with
Python80%
Rust14%
Updated today
Rust
41%
Other

Hook0

Devops

1,477

Open-source Webhooks-as-a-Service: deliver events to your users with auto-retry, signed payloads, and a real-time subscriber dashboard — all without building the infrastructure yourself.

View details
83
Repo Health
82
Technical
70
Dependency
Built with
Rust41%
TypeScript17%
JavaScript15%
Updated today
Rust
96%
Apache 2.0

InfluxDB

Databases · Analytics

31,705

Open-source time-series database built for real-time ingest, fast SQL queries, and embedded Python automation — powered by Apache Arrow and Parquet.

View details
86
Repo Health
76
Technical
72
Dependency
Built with
Rust96%
Updated yesterday
Rust
87%
AGPL 3.0

ParadeDB

Search · Databases · Analytics

9,175

Born out of Y Combinator's S2023 batch, ParadeDB is a Postgres extension that delivers Elasticsearch-quality BM25 search and real-time analytics without a separate search cluster to manage.

View details
88
Repo Health
87
Technical
71
Dependency
Built with
Rust87%
PLpgSQL12%
Updated today
Python
55%
Other

PostHog

Analytics · Monitoring · Developer Tools

37,777

The all-in-one open source product platform combining analytics, session replay, feature flags, error tracking, AI observability, and a built-in data warehouse in a single self-hostable stack.

View details
92
Repo Health
80
Technical
67
Dependency
Built with
Python55%
TypeScript36%
Updated today

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search