Unit testing is a daily activity of many programmers. It is performed in order to verify the behavior of the software under development. Property-based testing is an alternative and supplementary approach to unit testing. It allows for the description of the expected properties of software and for their verification, if these properties hold using automatically generated data.
In this chapter, we'll discuss the situations in which property-based testing can be especially useful, and look at how the expected properties can be formulated and the test data can be produced.
The following topics will be covered in this chapter:
- The concept of property-based testing
- Properties
- Generators
- Shrinkers
- Properties as laws