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 ...

Get Property-Based Testing with PropEr, Erlang, and Elixir now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.