Proptest

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

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

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
74 /100 Good
Development Activity 76
Maintenance 52
Community 68
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
83 /100 Excellent
Architecture 88
Code Quality 88
Innovation 86
Learning Curve 68

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 9 apps in this directory

Rust
88%
GPL 2.0

Fresh

Code Editors · Developer Tools

9,052

A zero-configuration terminal text editor with familiar keybindings, full mouse support, LSP-powered IDE features, and a built-in orchestrator for running multiple coding agents in parallel worktrees.

View details
86
Repo Health
88
Technical
71
Dependency
Built with
Rust 88%
Updated 5 days ago
Python
82%
Apache 2.0

headroom

AI Development · Developer Tools

73,966

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
85
Repo Health
86
Technical
69
Dependency
Built with
Python 82%
Rust 12%
Updated 5 days ago
Rust
37%
Other

Hook0

Devops

1,491

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
82
Repo Health
82
Technical
69
Dependency
Built with
Rust 37%
TypeScript 12%
Updated 1 weeks ago
Rust
96%
Apache 2.0

InfluxDB

Analytics · Databases

31,758

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
82
Repo Health
76
Technical
72
Dependency
Built with
Rust 96%
Updated 1 weeks ago
Rust
86%
AGPL 3.0

ParadeDB

Analytics · Databases · Search

9,311

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
89
Repo Health
87
Technical
68
Dependency
Built with
Rust 86%
PLpgSQL 14%
Updated 4 days ago
Rust
86%
AGPL 3.0

ParadeDB

Analytics · Databases · Search

9,311

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
89
Repo Health
87
Technical
68
Dependency
Built with
Rust 86%
PLpgSQL 14%
Updated 4 days ago
Python
55%
Other

PostHog

Ab Testing Experimentation · Analytics · Developer Tools

39,975

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
65
Dependency
Built with
Python 55%
TypeScript 36%
Updated 4 days ago
Rust
95%
Apache 2.0

RustFS

File Storage

33,997

A Rust-native, S3-compatible distributed object storage system built for AI, data lake, and big data workloads, licensed under Apache 2.0 with no AGPL restrictions.

View details
88
Repo Health
83
Technical
78
Dependency
Built with
Rust 95%
Updated 4 days ago
Rust
79%
Apache 2.0

TensorZero

Ab Testing Experimentation · AI Development · Monitoring

11,717

TensorZero unifies the LLM gateway, observability, evaluation, optimization, and experimentation stack behind a single OpenAI-compatible API, built in Rust for sub-millisecond p99 latency.

View details
53
Repo Health
87
Technical
69
Dependency
Built with
Rust 79%
TypeScript 15%
Updated 3 months ago

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