# burntsushi/quickcheck architecture

> Architecture diagram of the GitHub repository burntsushi/quickcheck, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/burntsushi/quickcheck
- Repository: https://github.com/burntsushi/quickcheck

## Overview

QuickCheck is a Rust property-testing library: users provide a property, and the library repeatedly tests it with generated inputs, shrinking failures to seek smaller counterexamples. Its runtime centers on `QuickCheck` and `Testable`; `Arbitrary` supplies generation and shrinking strategies. The crate also offers a declarative `quickcheck!` macro and a separate `#[quickcheck]` procedural macro that turns properties into Rust tests. The graph focuses on runtime behavior; unsampled implementation details are omitted, and optional logging is not mapped without evidence of its runtime wiring.

Main entry points: [`src/tester.rs`](https://github.com/burntsushi/quickcheck/blob/master/src/tester.rs) (QuickCheck Runner), [`src/lib.rs`](https://github.com/burntsushi/quickcheck/blob/master/src/lib.rs) (quickcheck!), [`quickcheck_macros/src/lib.rs`](https://github.com/burntsushi/quickcheck/blob/master/quickcheck_macros/src/lib.rs) (Attribute Macro), [`src/arbitrary.rs`](https://github.com/burntsushi/quickcheck/blob/master/src/arbitrary.rs) (Arbitrary Values)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Test Entry Points"]
  node_declarative["quickcheck!<br/>[lib.rs]"]
  node_attribute["Attribute Macro<br/>[lib.rs]"]
end

subgraph group_runtime["Test Runtime"]
  node_runner["QuickCheck Runner<br/>[tester.rs]"]
  node_testable["Testable Evaluation<br/>[tester.rs]"]
  node_result["Test Result<br/>[tester.rs]"]
end

subgraph group_values["Input Strategies"]
  node_arbitrary["Arbitrary Values<br/>[arbitrary.rs]"]
end

node_user(("Test Author"))
node_property["Property Function"]

node_user -->|"defines"| node_property
node_user -->|"uses"| node_declarative
node_user -->|"uses"| node_attribute
node_declarative -->|"invokes"| node_runner
node_attribute -->|"generates call"| node_runner
node_runner -->|"evaluates"| node_testable
node_testable -->|"generates and shrinks"| node_arbitrary
node_testable -->|"produces"| node_result
node_runner -->|"returns failure"| node_result

click node_declarative "https://github.com/burntsushi/quickcheck/blob/master/src/lib.rs"
click node_attribute "https://github.com/burntsushi/quickcheck/blob/master/quickcheck_macros/src/lib.rs"
click node_runner "https://github.com/burntsushi/quickcheck/blob/master/src/tester.rs"
click node_testable "https://github.com/burntsushi/quickcheck/blob/master/src/tester.rs"
click node_result "https://github.com/burntsushi/quickcheck/blob/master/src/tester.rs"
click node_arbitrary "https://github.com/burntsushi/quickcheck/blob/master/src/arbitrary.rs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_declarative,node_attribute toneBlue
class node_runner,node_testable,node_result toneAmber
class node_arbitrary toneMint
class node_user,node_property toneIndigo
```

## Components

### Test Entry Points

- [quickcheck!](https://github.com/burntsushi/quickcheck/blob/master/src/lib.rs): `src/lib.rs`
- [Attribute Macro](https://github.com/burntsushi/quickcheck/blob/master/quickcheck_macros/src/lib.rs): `quickcheck_macros/src/lib.rs`

### Test Runtime

- [QuickCheck Runner](https://github.com/burntsushi/quickcheck/blob/master/src/tester.rs): `src/tester.rs`
- [Testable Evaluation](https://github.com/burntsushi/quickcheck/blob/master/src/tester.rs): `src/tester.rs`
- [Test Result](https://github.com/burntsushi/quickcheck/blob/master/src/tester.rs): `src/tester.rs`

### Input Strategies

- [Arbitrary Values](https://github.com/burntsushi/quickcheck/blob/master/src/arbitrary.rs): `src/arbitrary.rs`

### Other components

- **Test Author**
- **Property Function**

## Connections

- Test Author → Property Function: defines (evidence: `README.md`)
- Test Author → quickcheck!: uses (evidence: `README.md`)
- Test Author → Attribute Macro: uses (evidence: `README.md`)
- quickcheck! → QuickCheck Runner: invokes (evidence: `src/lib.rs`)
- Attribute Macro → QuickCheck Runner: generates call (evidence: `quickcheck_macros/src/lib.rs`)
- QuickCheck Runner → Testable Evaluation: evaluates (evidence: `src/tester.rs`)
- Testable Evaluation → Arbitrary Values: generates and shrinks (evidence: `src/tester.rs`)
- Testable Evaluation → Test Result: produces (evidence: `src/tester.rs`)
- QuickCheck Runner → Test Result: returns failure (evidence: `src/tester.rs`)
