What does the machine generate in property-based testing?
- The final release notes
- Hundreds of inputs trying to break the rule
- The fixed version of your code
Which of these is a property a sorting function must satisfy for any list?
- The output is ordered and holds the same elements
- The output of [3, 1, 2] is [1, 2, 3]
- The function runs in under a second
Shrinking turns a failing input into the smallest one that still fails.
Circle one: True False
Which pair of properties should a parser and its printer satisfy together?
- Parsing printed output returns the original, and printing parsed input is stable
- The parser is fast and the printer is short
- Both handle the same file extension
A 900-element list breaks your sorting property. Why is shrinking useful here?
- It makes the sort run faster
- It adds more random elements
- It trims the failure to a tiny case that shows the cause
What would a generator try in order to break a round-trip property?
- Only the inputs from your documentation
- Empty inputs, odd symbols, and deeply nested cases
- Inputs that are already known to pass
Your property holds for 10,000 generated inputs, yet users hit a wrong fee on one real invoice. What does this teach?
- Generators replace all business-rule examples
- Properties hunt surprises, but concrete rules still need example tests
- Shrinking caused the wrong fee
A property says reversed twice returns the original, and it passes. A reviewer still asks for one example test with an exact output. Why?
- Properties cannot run without examples beside them
- Shrinking only works on hand-written cases
- Exact outputs and concrete rules need pinning down