> A different testing style is property based testing (PBT) with contracts. By generating a random set of inputs, we cover more of the state space than we’d do manually.
> A different testing style is property based testing (PBT) with contracts. By testing invariant properties like commutativity instead of specific cases, and writing the functions under test with assertion-like contracts that fail if they ever attempt invalid behavior, we can test with random input data and cover more of the search space than we would manually.
I think it is a trade off between being accurate with language and engaging the reader. If we were being accurate we would need to say that random sampling is only necessary if the domain is infinitely sized or very large.
I had a this problem when writing a very similar blog post.
For someone new to the way you define property and contracts, the second sentence is not enough definition. The article made sense once I found other links in the article defining property and contracts: https://fsharpforfunandprofit.com/posts/property-based-testi... and https://www.hillelwayne.com/post/contracts/.
I would summarize by saying
> A different testing style is property based testing (PBT) with contracts. By testing invariant properties like commutativity instead of specific cases, and writing the functions under test with assertion-like contracts that fail if they ever attempt invalid behavior, we can test with random input data and cover more of the search space than we would manually.