Wrapping Up
When it comes to writing properties, you’re now in a pretty good place. You should feel better about balancing properties with regular example-based unit tests, as we’ve seen for regression cases. Using example tests as an anchoring mechanism to backstop your properties can help make them a lot more trustworthy. In some cases, just exhaustively enumerating the whole data set is a possibility, letting you cover more than what properties would in the first place.
Your experience gained writing properties against a well-specified program is sure to prove useful, but property-based testing has another face entirely. We can use properties to explore the design of our program itself, rather than just testing a well-specified one. In the ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access