Introduction to Targeted Properties
Get introduced to targeted properties, what they look like, and their limitations.
What is a targeted property?
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, we’ll learn about targeted properties. They let us use generic generators and specialize them from within the property so that they generate data more relevant to the property.
Understanding targeting properties
Regular properties work by using generators to create random data for each iteration of a test, running ...