Default Generators
Generators are a huge part of where a property-based testing framework’s magic comes from. While we do the hard work of coming up with properties, the efficiency with which they will be exercised entirely depends on what kind of inputs will be passed to them. A framework with bad generators is not an interesting framework, and great generators will directly impact how much trust you can put in your tests.
Generators are functions that contain a bunch of internal parameters that direct their randomness, how the data they create gets more or less complex, and information about other generators that can be used as parameters. We really don’t need to know how their internals work to use them; from our point of view, they’re just ...
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