2. Goals of the day
• Underestanding DOs and DON’Ts of PBT
• Formulating your own properties for pure functions
• Designing and generating test data sets on the fly
• And making you eager for more!
2/10
3. Goals of the day
• Underestanding DOs and DON’Ts of PBT
• Formulating your own properties for pure functions
• Designing and generating test data sets on the fly
• And making you eager for more!
2/10
4. Goals of the day
• Underestanding DOs and DON’Ts of PBT
• Formulating your own properties for pure functions
• Designing and generating test data sets on the fly
• And making you eager for more!
2/10
5. Goals of the day
• Underestanding DOs and DON’Ts of PBT
• Formulating your own properties for pure functions
• Designing and generating test data sets on the fly
• And making you eager for more!
2/10
6. Property Based Testing
Training Setup
• github.com/spilgames/PropEr@ErlangDCRB13
README.md
Makefile + rebar
src/ with source and properties
test/*_eunit.erl as test controllers
3/10
7. Property Based Testing
The Idea
• What properties should hold?
• Properties document your code
• Properties generate the testcases
• Shrinking towards the smallest input that crashes
4/10
8. Property Based Testing
The Idea
• What properties should hold?
• Properties document your code
• Properties generate the testcases
• Shrinking towards the smallest input that crashes
4/10
9. Property Based Testing
The Idea
• What properties should hold?
• Properties document your code
• Properties generate the testcases
• Shrinking towards the smallest input that crashes
4/10
10. Property Based Testing
The Idea
• What properties should hold?
• Properties document your code
• Properties generate the testcases
• Shrinking towards the smallest input that crashes
4/10
11. Property Based Testing
Available Tools
• Available for multiple languages
• Open Source
• Trainings and support (at a price)
• Plenty of documentation
• Pulse for concurrency issues
• Using & contributing via Github
5/10
13. Conclusions
The Stuff You’re Supposed To Remember
• Start with simple tests
• Think properties
• Always test your generators first
• Test a reasonable success/error rate
7/10
14. Conclusions
A Practical View
• Property Driven Development is not a thing
Thinking properties is hard
Refactoring properties is hard
Manual basic testcases help you think
• Naming is essential
• Avoid reimplementating + comparing
• PBT finds stuff you’d never think of
8/10
15. Conclusions
A Practical View
• Property Driven Development is not a thing
Thinking properties is hard
Refactoring properties is hard
Manual basic testcases help you think
• Naming is essential
• Avoid reimplementating + comparing
• PBT finds stuff you’d never think of
8/10
16. Conclusions
More Info
• PropEr @github
• PropEr Docs
• Quickcheck For Erlang
• Concuerror @github
• Concuerror Presentation
9/10