Property-Based Testing Guide
Use this skill proactively during development when you encounter patterns where PBT provides stronger coverage than example-based tests.
Go / rapid (Primary for Go Code)
For Go code, always use pgregory.net/rapid as the property-based testing library. Do NOT use testing/quick -- it is limited, lacks proper shrinking, and has poor generator support.
Why rapid over testing/quick
- Automatic shrinking of failing cases to minimal counterexamples.
- Rich generator combinators:
IntRange, SliceOf, Map, Custom, OneOf, Ptr, SampledFrom.
- Stateful testing via
rapid.StateMachine for testing stateful systems.
- Integrates with standard
*testing.T via rapid.Check.
- Actively maintained with good documentation.
rapid Core Pattern
func TestRoundtrip(t *testing.T) {
rapid.Check(t, func(t *rapid.T) {
msg := genMessage().Draw(t, "msg")
encoded := Encode(msg)
decoded, err := Decode(encoded)
if err != nil {
t.Fatal(err)
}
if !reflect.DeepEqual(msg, decoded) {
t.Fatalf("roundtrip failed: got %v, want %v", decoded, msg)
}
})
}
rapid Generators
| Generator |
Description |
Example |
rapid.Int() |
Any int |
rapid.Int().Draw(t, "n") |
rapid.IntRange(lo, hi) |
Bounded int |
rapid.IntRange(0, 100).Draw(t, "n") |
rapid.Int64() |
Any int64 |
rapid.Int64().Draw(t, "n") |
rapid.Uint64() |
Any uint64 |
rapid.Uint64().Draw(t, "n") |
rapid.Float64() |
Any float64 |
rapid.Float64().Draw(t, "f") |
rapid.Bool() |
true or false |
rapid.Bool().Draw(t, "b") |
rapid.String() |
Any string |
rapid.String().Draw(t, "s") |
rapid.StringN(minLen, maxLen, maxRunes) |
Bounded string |
rapid.StringN(1, 50, -1).Draw(t, "s") |
rapid.Byte() |
Single byte |
rapid.Byte().Draw(t, "b") |
rapid.SliceOf(gen) |
Slice of elements |
rapid.SliceOf(rapid.Int()).Draw(t, "xs") |
rapid.SliceOfN(gen, min, max) |
Bounded slice |
rapid.SliceOfN(rapid.Int(), 1, 10).Draw(t, "xs") |
rapid.MapOf(keyGen, valGen) |
Map |
rapid.MapOf(rapid.String(), rapid.Int()).Draw(t, "m") |
rapid.SampledFrom(slice) |
One of values |
rapid.SampledFrom([]string{"a","b"}).Draw(t, "s") |
rapid.OneOf(gens...) |
One of generators |
rapid.OneOf(rapid.Int(), rapid.Int()).Draw(t, "n") |
rapid.Just(val) |
Constant value |
rapid.Just(42).Draw(t, "n") |
rapid.Ptr(gen, allowNil) |
Pointer |
rapid.Ptr(rapid.Int(), true).Draw(t, "p") |
rapid.Map(gen, fn) |
Transform |
rapid.Map(rapid.Int(), func(n int) uint { return uint(n&0xff) }) |
rapid.Custom(fn) |
Custom generator |
See below |
Custom Generators
func genMessage() *rapid.Generator[Message] {
return rapid.Custom(func(t *rapid.T) Message {
return Message{
ID: rapid.IntRange(1, 10000).Draw(t, "id"),
Content: rapid.StringN(0, 1000, -1).Draw(t, "content"),
Priority: rapid.IntRange(1, 10).Draw(t, "priority"),
Tags: rapid.SliceOfN(rapid.StringN(1, 50, -1), 0, 20).Draw(t, "tags"),
}
})
}
Stateful Testing with rapid.StateMachine
For testing stateful systems (data structures, databases, protocol state machines):
type queueMachine struct {
queue Queue // System under test.
model []int // Reference model.
}
func (m *queueMachine) Init(t *rapid.T) {
m.queue = NewQueue()
m.model = nil
}
func (m *queueMachine) Push(t *rapid.T) {
v := rapid.Int().Draw(t, "v")
m.queue.Push(v)
m.model = append(m.model, v)
}
func (m *queueMachine) Pop(t *rapid.T) {
if len(m.model) == 0 {
t.Skip("empty queue")
}
got := m.queue.Pop()
want := m.model[0]
m.model = m.model[1:]
if got != want {
t.Fatalf("got %d, want %d", got, want)
}
}
func (m *queueMachine) Check(t *rapid.T) {
if m.queue.Len() != len(m.model) {
t.Fatalf("length mismatch: got %d, want %d", m.queue.Len(), len(m.model))
}
}
func TestQueue(t *testing.T) {
rapid.Check(t, rapid.Run[*queueMachine]())
}
Go Property Test Patterns
Roundtrip (encode/decode):
func TestCodecRoundtrip(t *testing.T) {
rapid.Check(t, func(t *rapid.T) {
original := genMessage().Draw(t, "msg")
encoded, err := Encode(original)
if err != nil {
t.Fatal(err)
}
decoded, err := Decode(encoded)
if err != nil {
t.Fatal(err)
}
if !reflect.DeepEqual(original, decoded) {
t.Fatalf("roundtrip failed: %v != %v", original, decoded)
}
})
}
Idempotence (normalization):
func TestNormalizeIdempotent(t *testing.T) {
rapid.Check(t, func(t *rapid.T) {
s := rapid.String().Draw(t, "s")
once := Normalize(s)
twice := Normalize(once)
if once != twice {
t.Fatalf("not idempotent: Normalize(%q) = %q, Normalize(%q) = %q",
s, once, once, twice)
}
})
}
Sorting properties:
func TestSort(t *testing.T) {
rapid.Check(t, func(t *rapid.T) {
xs := rapid.SliceOf(rapid.Int()).Draw(t, "xs")
result := MySort(xs)
// Length preserved.
if len(result) != len(xs) {
t.Fatalf("length changed: %d -> %d", len(xs), len(result))
}
// Ordered.
for i := 1; i < len(result); i++ {
if result[i-1] > result[i] {
t.Fatalf("not sorted at index %d: %d > %d", i, result[i-1], result[i])
}
}
// Idempotent.
result2 := MySort(result)
if !reflect.DeepEqual(result, result2) {
t.Fatal("sort not idempotent")
}
})
}
Oracle (reference implementation):
func TestOptimizedMatchesReference(t *testing.T) {
rapid.Check(t, func(t *rapid.T) {
input := rapid.SliceOf(rapid.Int()).Draw(t, "input")
got := OptimizedImpl(input)
want := ReferenceImpl(input)
if !reflect.DeepEqual(got, want) {
t.Fatalf("mismatch: optimized=%v, reference=%v", got, want)
}
})
}
When to Invoke (Automatic Detection)
Invoke this skill when you detect:
- Serialization pairs:
encode/decode, serialize/deserialize, toJSON/fromJSON, pack/unpack, Marshal/Unmarshal
- Parsers: URL parsing, config parsing, protocol parsing, string-to-structured-data
- Normalization:
normalize, sanitize, clean, canonicalize, format
- Validators:
is_valid, validate, check_* (especially with normalizers)
- Data structures: Custom collections with
add/remove/get operations
- Mathematical/algorithmic: Pure functions, sorting, ordering, comparators
- Smart contracts: Solidity/Vyper contracts, token operations, state invariants, access control
- State machines: Protocol state, connection lifecycle, workflow transitions (use
rapid.StateMachine)
Priority by pattern:
| Pattern |
Property |
Priority |
| encode/decode pair |
Roundtrip |
HIGH |
| Pure function |
Multiple |
HIGH |
| State machine |
Invariants via StateMachine |
HIGH |
| Validator |
Valid after normalize |
MEDIUM |
| Sorting/ordering |
Idempotence + ordering |
MEDIUM |
| Normalization |
Idempotence |
MEDIUM |
| Builder/factory |
Output invariants |
LOW |
| Smart contract |
State invariants |
HIGH |
When NOT to Use
Do NOT use this skill for:
- Simple CRUD operations without transformation logic
- One-off scripts or throwaway code
- Code with side effects that cannot be isolated (network calls, database writes)
- Tests where specific example cases are sufficient and edge cases are well-understood
- Integration or end-to-end testing (PBT is best for unit/component testing)
Property Catalog (Quick Reference)
| Property |
Formula |
When to Use |
| Roundtrip |
decode(encode(x)) == x |
Serialization, conversion pairs |
| Idempotence |
f(f(x)) == f(x) |
Normalization, formatting, sorting |
| Invariant |
Property holds before/after |
Any transformation |
| Commutativity |
f(a, b) == f(b, a) |
Binary/set operations |
| Associativity |
f(f(a,b), c) == f(a, f(b,c)) |
Combining operations |
| Identity |
f(x, identity) == x |
Operations with neutral element |
| Inverse |
f(g(x)) == x |
encrypt/decrypt, compress/decompress |
| Oracle |
new_impl(x) == reference(x) |
Optimization, refactoring |
| Easy to Verify |
is_sorted(sort(x)) |
Complex algorithms |
| No Exception |
No crash on valid input |
Baseline property |
Strength hierarchy (weakest to strongest):
No Exception -> Type Preservation -> Invariant -> Idempotence -> Roundtrip
Decision Tree
Based on the current task, read the appropriate section:
TASK: Writing new tests
-> Read [{baseDir}/references/generating.md]({baseDir}/references/generating.md) (test generation patterns and examples)
-> Then [{baseDir}/references/strategies.md]({baseDir}/references/strategies.md) if input generation is complex
TASK: Designing a new feature
-> Read [{baseDir}/references/design.md]({baseDir}/references/design.md) (Property-Driven Development approach)
TASK: Code is difficult to test (mixed I/O, missing inverses)
-> Read [{baseDir}/references/refactoring.md]({baseDir}/references/refactoring.md) (refactoring patterns for testability)
TASK: Reviewing existing PBT tests
-> Read [{baseDir}/references/reviewing.md]({baseDir}/references/reviewing.md) (quality checklist and anti-patterns)
TASK: Test failed, need to interpret
-> Read [{baseDir}/references/interpreting-failures.md]({baseDir}/references/interpreting-failures.md) (failure analysis and bug classification)
TASK: Need library reference
-> Read [{baseDir}/references/libraries.md]({baseDir}/references/libraries.md) (PBT libraries by language, includes smart contract tools)
How to Suggest PBT
When you detect a high-value pattern while writing tests, offer PBT as an option:
"I notice Encode/Decode is a serialization pair. Property-based testing with a roundtrip property using rapid.Check would provide stronger coverage than example tests. Want me to use that approach?"
If codebase already uses a PBT library (rapid, Hypothesis, fast-check, proptest, Echidna), be more direct:
"This codebase uses rapid. I'll write property-based tests for this serialization pair using a roundtrip property."
If Go codebase uses testing/quick, suggest migration:
"I see this codebase uses testing/quick. The rapid library (pgregory.net/rapid) provides better shrinking, richer generators, and stateful testing support. Want me to use rapid for the new tests?"
If user declines, write good example-based tests without further prompting.
When NOT to Use PBT
- Simple CRUD without complex validation
- UI/presentation logic
- Integration tests requiring complex external setup
- Prototyping where requirements are fluid
- User explicitly requests example-based tests only
Red Flags
- Recommending trivial getters/setters
- Missing paired operations (encode without decode)
- Ignoring type hints (well-typed = easier to test)
- Overwhelming user with candidates (limit to top 5-10)
- Being pushy after user declines
Rationalizations to Reject
Do not accept these shortcuts:
- "Example tests are good enough" - If serialization/parsing/normalization is involved, PBT finds edge cases examples miss
- "The function is simple" - Simple functions with complex input domains (strings, floats, nested structures) benefit most from PBT
- "We don't have time" - PBT tests are often shorter than comprehensive example suites
- "It's too hard to write generators" - rapid has excellent built-in generators and
rapid.Custom makes custom ones trivial
- "The test failed, so it's a bug" - Failures require validation; see {baseDir}/references/interpreting-failures.md
- "No crash means it works" - "No exception" is the weakest property; always push for stronger guarantees
- "testing/quick is good enough" - It lacks proper shrinking, has limited generators, and is effectively unmaintained; use rapid instead
1---2name: property-based-testing3description: Provides guidance for property-based testing across multiple languages and smart contracts. Use when writing tests, reviewing code with serialization/validation/parsing patterns, designing features, or when property-based testing would provide stronger coverage than example-based tests. For Go code, uses pgregory.net/rapid as the primary PBT framework.4---56# Property-Based Testing Guide78Use this skill proactively during development when you encounter patterns where PBT provides stronger coverage than example-based tests.910## Go / rapid (Primary for Go Code)1112For Go code, **always use `pgregory.net/rapid`** as the property-based testing library. Do NOT use `testing/quick` -- it is limited, lacks proper shrinking, and has poor generator support.1314### Why rapid over testing/quick1516- Automatic shrinking of failing cases to minimal counterexamples.17- Rich generator combinators: `IntRange`, `SliceOf`, `Map`, `Custom`, `OneOf`, `Ptr`, `SampledFrom`.18- Stateful testing via `rapid.StateMachine` for testing stateful systems.19- Integrates with standard `*testing.T` via `rapid.Check`.20- Actively maintained with good documentation.2122### rapid Core Pattern2324```go25func TestRoundtrip(t *testing.T) {26 rapid.Check(t, func(t *rapid.T) {27 msg := genMessage().Draw(t, "msg")28 encoded := Encode(msg)29 decoded, err := Decode(encoded)30 if err != nil {31 t.Fatal(err)32 }33 if !reflect.DeepEqual(msg, decoded) {34 t.Fatalf("roundtrip failed: got %v, want %v", decoded, msg)35 }36 })37}38```3940### rapid Generators4142| Generator | Description | Example |43|-----------|-------------|---------|44| `rapid.Int()` | Any int | `rapid.Int().Draw(t, "n")` |45| `rapid.IntRange(lo, hi)` | Bounded int | `rapid.IntRange(0, 100).Draw(t, "n")` |46| `rapid.Int64()` | Any int64 | `rapid.Int64().Draw(t, "n")` |47| `rapid.Uint64()` | Any uint64 | `rapid.Uint64().Draw(t, "n")` |48| `rapid.Float64()` | Any float64 | `rapid.Float64().Draw(t, "f")` |49| `rapid.Bool()` | true or false | `rapid.Bool().Draw(t, "b")` |50| `rapid.String()` | Any string | `rapid.String().Draw(t, "s")` |51| `rapid.StringN(minLen, maxLen, maxRunes)` | Bounded string | `rapid.StringN(1, 50, -1).Draw(t, "s")` |52| `rapid.Byte()` | Single byte | `rapid.Byte().Draw(t, "b")` |53| `rapid.SliceOf(gen)` | Slice of elements | `rapid.SliceOf(rapid.Int()).Draw(t, "xs")` |54| `rapid.SliceOfN(gen, min, max)` | Bounded slice | `rapid.SliceOfN(rapid.Int(), 1, 10).Draw(t, "xs")` |55| `rapid.MapOf(keyGen, valGen)` | Map | `rapid.MapOf(rapid.String(), rapid.Int()).Draw(t, "m")` |56| `rapid.SampledFrom(slice)` | One of values | `rapid.SampledFrom([]string{"a","b"}).Draw(t, "s")` |57| `rapid.OneOf(gens...)` | One of generators | `rapid.OneOf(rapid.Int(), rapid.Int()).Draw(t, "n")` |58| `rapid.Just(val)` | Constant value | `rapid.Just(42).Draw(t, "n")` |59| `rapid.Ptr(gen, allowNil)` | Pointer | `rapid.Ptr(rapid.Int(), true).Draw(t, "p")` |60| `rapid.Map(gen, fn)` | Transform | `rapid.Map(rapid.Int(), func(n int) uint { return uint(n&0xff) })` |61| `rapid.Custom(fn)` | Custom generator | See below |6263### Custom Generators6465```go66func genMessage() *rapid.Generator[Message] {67 return rapid.Custom(func(t *rapid.T) Message {68 return Message{69 ID: rapid.IntRange(1, 10000).Draw(t, "id"),70 Content: rapid.StringN(0, 1000, -1).Draw(t, "content"),71 Priority: rapid.IntRange(1, 10).Draw(t, "priority"),72 Tags: rapid.SliceOfN(rapid.StringN(1, 50, -1), 0, 20).Draw(t, "tags"),73 }74 })75}76```7778### Stateful Testing with rapid.StateMachine7980For testing stateful systems (data structures, databases, protocol state machines):8182```go83type queueMachine struct {84 queue Queue // System under test.85 model []int // Reference model.86}8788func (m *queueMachine) Init(t *rapid.T) {89 m.queue = NewQueue()90 m.model = nil91}9293func (m *queueMachine) Push(t *rapid.T) {94 v := rapid.Int().Draw(t, "v")95 m.queue.Push(v)96 m.model = append(m.model, v)97}9899func (m *queueMachine) Pop(t *rapid.T) {100 if len(m.model) == 0 {101 t.Skip("empty queue")102 }103 got := m.queue.Pop()104 want := m.model[0]105 m.model = m.model[1:]106 if got != want {107 t.Fatalf("got %d, want %d", got, want)108 }109}110111func (m *queueMachine) Check(t *rapid.T) {112 if m.queue.Len() != len(m.model) {113 t.Fatalf("length mismatch: got %d, want %d", m.queue.Len(), len(m.model))114 }115}116117func TestQueue(t *testing.T) {118 rapid.Check(t, rapid.Run[*queueMachine]())119}120```121122### Go Property Test Patterns123124**Roundtrip (encode/decode):**125```go126func TestCodecRoundtrip(t *testing.T) {127 rapid.Check(t, func(t *rapid.T) {128 original := genMessage().Draw(t, "msg")129 encoded, err := Encode(original)130 if err != nil {131 t.Fatal(err)132 }133 decoded, err := Decode(encoded)134 if err != nil {135 t.Fatal(err)136 }137 if !reflect.DeepEqual(original, decoded) {138 t.Fatalf("roundtrip failed: %v != %v", original, decoded)139 }140 })141}142```143144**Idempotence (normalization):**145```go146func TestNormalizeIdempotent(t *testing.T) {147 rapid.Check(t, func(t *rapid.T) {148 s := rapid.String().Draw(t, "s")149 once := Normalize(s)150 twice := Normalize(once)151 if once != twice {152 t.Fatalf("not idempotent: Normalize(%q) = %q, Normalize(%q) = %q",153 s, once, once, twice)154 }155 })156}157```158159**Sorting properties:**160```go161func TestSort(t *testing.T) {162 rapid.Check(t, func(t *rapid.T) {163 xs := rapid.SliceOf(rapid.Int()).Draw(t, "xs")164 result := MySort(xs)165166 // Length preserved.167 if len(result) != len(xs) {168 t.Fatalf("length changed: %d -> %d", len(xs), len(result))169 }170171 // Ordered.172 for i := 1; i < len(result); i++ {173 if result[i-1] > result[i] {174 t.Fatalf("not sorted at index %d: %d > %d", i, result[i-1], result[i])175 }176 }177178 // Idempotent.179 result2 := MySort(result)180 if !reflect.DeepEqual(result, result2) {181 t.Fatal("sort not idempotent")182 }183 })184}185```186187**Oracle (reference implementation):**188```go189func TestOptimizedMatchesReference(t *testing.T) {190 rapid.Check(t, func(t *rapid.T) {191 input := rapid.SliceOf(rapid.Int()).Draw(t, "input")192 got := OptimizedImpl(input)193 want := ReferenceImpl(input)194 if !reflect.DeepEqual(got, want) {195 t.Fatalf("mismatch: optimized=%v, reference=%v", got, want)196 }197 })198}199```200201## When to Invoke (Automatic Detection)202203**Invoke this skill when you detect:**204205- **Serialization pairs**: `encode`/`decode`, `serialize`/`deserialize`, `toJSON`/`fromJSON`, `pack`/`unpack`, `Marshal`/`Unmarshal`206- **Parsers**: URL parsing, config parsing, protocol parsing, string-to-structured-data207- **Normalization**: `normalize`, `sanitize`, `clean`, `canonicalize`, `format`208- **Validators**: `is_valid`, `validate`, `check_*` (especially with normalizers)209- **Data structures**: Custom collections with `add`/`remove`/`get` operations210- **Mathematical/algorithmic**: Pure functions, sorting, ordering, comparators211- **Smart contracts**: Solidity/Vyper contracts, token operations, state invariants, access control212- **State machines**: Protocol state, connection lifecycle, workflow transitions (use `rapid.StateMachine`)213214**Priority by pattern:**215216| Pattern | Property | Priority |217|---------|----------|----------|218| encode/decode pair | Roundtrip | HIGH |219| Pure function | Multiple | HIGH |220| State machine | Invariants via StateMachine | HIGH |221| Validator | Valid after normalize | MEDIUM |222| Sorting/ordering | Idempotence + ordering | MEDIUM |223| Normalization | Idempotence | MEDIUM |224| Builder/factory | Output invariants | LOW |225| Smart contract | State invariants | HIGH |226227## When NOT to Use228229Do NOT use this skill for:230- Simple CRUD operations without transformation logic231- One-off scripts or throwaway code232- Code with side effects that cannot be isolated (network calls, database writes)233- Tests where specific example cases are sufficient and edge cases are well-understood234- Integration or end-to-end testing (PBT is best for unit/component testing)235236## Property Catalog (Quick Reference)237238| Property | Formula | When to Use |239|----------|---------|-------------|240| **Roundtrip** | `decode(encode(x)) == x` | Serialization, conversion pairs |241| **Idempotence** | `f(f(x)) == f(x)` | Normalization, formatting, sorting |242| **Invariant** | Property holds before/after | Any transformation |243| **Commutativity** | `f(a, b) == f(b, a)` | Binary/set operations |244| **Associativity** | `f(f(a,b), c) == f(a, f(b,c))` | Combining operations |245| **Identity** | `f(x, identity) == x` | Operations with neutral element |246| **Inverse** | `f(g(x)) == x` | encrypt/decrypt, compress/decompress |247| **Oracle** | `new_impl(x) == reference(x)` | Optimization, refactoring |248| **Easy to Verify** | `is_sorted(sort(x))` | Complex algorithms |249| **No Exception** | No crash on valid input | Baseline property |250251**Strength hierarchy** (weakest to strongest):252No Exception -> Type Preservation -> Invariant -> Idempotence -> Roundtrip253254## Decision Tree255256Based on the current task, read the appropriate section:257258```259TASK: Writing new tests260 -> Read [{baseDir}/references/generating.md]({baseDir}/references/generating.md) (test generation patterns and examples)261 -> Then [{baseDir}/references/strategies.md]({baseDir}/references/strategies.md) if input generation is complex262263TASK: Designing a new feature264 -> Read [{baseDir}/references/design.md]({baseDir}/references/design.md) (Property-Driven Development approach)265266TASK: Code is difficult to test (mixed I/O, missing inverses)267 -> Read [{baseDir}/references/refactoring.md]({baseDir}/references/refactoring.md) (refactoring patterns for testability)268269TASK: Reviewing existing PBT tests270 -> Read [{baseDir}/references/reviewing.md]({baseDir}/references/reviewing.md) (quality checklist and anti-patterns)271272TASK: Test failed, need to interpret273 -> Read [{baseDir}/references/interpreting-failures.md]({baseDir}/references/interpreting-failures.md) (failure analysis and bug classification)274275TASK: Need library reference276 -> Read [{baseDir}/references/libraries.md]({baseDir}/references/libraries.md) (PBT libraries by language, includes smart contract tools)277```278279## How to Suggest PBT280281When you detect a high-value pattern while writing tests, **offer PBT as an option**:282283> "I notice `Encode`/`Decode` is a serialization pair. Property-based testing with a roundtrip property using `rapid.Check` would provide stronger coverage than example tests. Want me to use that approach?"284285**If codebase already uses a PBT library** (rapid, Hypothesis, fast-check, proptest, Echidna), be more direct:286287> "This codebase uses rapid. I'll write property-based tests for this serialization pair using a roundtrip property."288289**If Go codebase uses `testing/quick`**, suggest migration:290291> "I see this codebase uses `testing/quick`. The `rapid` library (`pgregory.net/rapid`) provides better shrinking, richer generators, and stateful testing support. Want me to use rapid for the new tests?"292293**If user declines**, write good example-based tests without further prompting.294295## When NOT to Use PBT296297- Simple CRUD without complex validation298- UI/presentation logic299- Integration tests requiring complex external setup300- Prototyping where requirements are fluid301- User explicitly requests example-based tests only302303## Red Flags304305- Recommending trivial getters/setters306- Missing paired operations (encode without decode)307- Ignoring type hints (well-typed = easier to test)308- Overwhelming user with candidates (limit to top 5-10)309- Being pushy after user declines310311## Rationalizations to Reject312313Do not accept these shortcuts:314315- **"Example tests are good enough"** - If serialization/parsing/normalization is involved, PBT finds edge cases examples miss316- **"The function is simple"** - Simple functions with complex input domains (strings, floats, nested structures) benefit most from PBT317- **"We don't have time"** - PBT tests are often shorter than comprehensive example suites318- **"It's too hard to write generators"** - rapid has excellent built-in generators and `rapid.Custom` makes custom ones trivial319- **"The test failed, so it's a bug"** - Failures require validation; see [{baseDir}/references/interpreting-failures.md]({baseDir}/references/interpreting-failures.md)320- **"No crash means it works"** - "No exception" is the weakest property; always push for stronger guarantees321- **"testing/quick is good enough"** - It lacks proper shrinking, has limited generators, and is effectively unmaintained; use rapid instead