What Is a Property?
4 days ago
- #software-testing
- #property-based-testing
- #quickcheck
- Property-based testing (PBT) involves properties defining correctness and generators defining the domain, with frameworks combining them.
- Real-world PBT requires dependent generators, where generated values depend on each other to ensure valid inputs and avoid precondition failures.
- The boundary between properties and generators is often blurred, allowing generation logic to incorporate preconditions, shifting some property checks into generators.
- Some PBT frameworks (like QuickCheck's forAll) support integrated property-generation writing, while others (e.g., Rust's quickcheck) may impose stricter separation, limiting expressiveness.
- The discussion highlights the importance of flexible PBT abstractions that allow intermixing generation and property evaluation, as seen in tools like Hypothesis and Hegel.