Chapter 8Targeted Properties
So far, the properties we have written have been rather tightly coupled with generators, since by needing to write specific properties, we tend to need specific generators. More general generators tend to be more useful when we do broader scanning rather than intricate validation, and so we rarely can have just one generator that can do it all.
This is necessary because we need to control randomness to some extent. In this chapter, you’ll learn about targeted properties, which are straight up witchcraft. They let you use generic generators and from within the property specialize them so they generate data more relevant to the property. You can use them for simple stuff like “make the numbers in the list bigger,” ...
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