May 2019
Intermediate to advanced
496 pages
10h 38m
English
In traditional TDD, we find a small set of specifications or examples to test our functions against. Property-based testing is different: it generates a large set of tests based on a definition of what the inputs to those functions should be. The test framework is responsible for generating the input data and the tests.
For example, if I had a function that converted Fahrenheit to Celsius, I could use a generative test framework to generate tests for a large, random sample of integer-valued Fahrenheit measurements and ensure that each of them converts to the correct Celsius value.
This kind of testing does not replace TDD, but is another tool in the TDD practitioner's toolbox.
Property-based testing is ...
Read now
Unlock full access