Fancy Custom Generators

You can get pretty far with just the basic techniques, but whenever they can’t bring you up to where you want your generators to be, you’ll have to look into more advanced techniques. But even then, the advanced techniques will still make use of the basic ones, so don’t worry, they’ll remain useful.

In this section, we’ll focus on how we can make use of the basic techniques and put them in a fancier context through writing our own recursive generators, with some need for laziness. We’ll then finish it up by introducing symbolic calls, which help make complex generators more understandable once properties fail.

Recursive Generators

Whenever a piece of data can be represented by a repetitive or well-ordered structure, or ...

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.