An introduction to Property-Based Testing. The main goal of this presentation is to fill in the gaps that other PBT presentations do not.
It covers the following:
- The similarities and differences between Example-Based Testing and Property-Based Testing
- Introduction to Generators
- How to choose Properties
- Introduction to Shrinkers
- A few examples of increasing complexity with both EBT and PBT.
- Some guidelines on when to use EBT and PBT.
To continuously run any test through SBT use:
~test-only *TestName
For example:
~test-only *AdditionTest
or
~test-only *AdditionProps
To run a test with more than a hundred permutations use:
test:run -s number_of_permutations
and then choose the required test from the menu.
For example:
test:run -s 10000
- The lazy programmer's guide to writing 1000's of tests: An introduction to property based testing - Scott Wlaschin
- SBTB 2014 - I Dream of Gen'ning - Kelsey Gilmore-Innis
- Practical Property-Based Testing - Charles O'Farrell
- Midwest.io 2014 - Property-Based Testing for Better Code - Jessica Kerr
- Testing the Hard Stuff and Staying Sane - John Hughes