Wrapping Up

We’ve covered what is pretty much an optimization when we have large counterexamples that PropEr doesn’t necessarily know how to handle. By using the ?SHRINK macro, you can let it know how to retarget shrinking toward more meaningful neutral values for a given generator. You’ve also seen that with ?LETSHRINK, we can give PropEr tips on how to divide up a data structure to find problems with more ease.

With shrinking under your belt, you now have pretty much all of the tools you’ll need to handle stateless property tests. In fact, we’re almost done with stateless properties. Right now, the only thing left to see is a brand new PropEr feature called Targeted Property-Based Testing, which at this point will just be a bonus for some amazing ...

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.