+ All Categories
Home > Technology > PropErty based testing

PropErty based testing

Date post: 22-Apr-2015
Category:
Upload: enriquepazperez
View: 183 times
Download: 2 times
Share this document with a friend
Description:
 
17
PropErty Based Testing Enrique Paz @quiquepaz Rolph de Ruiter 1/10
Transcript
Page 1: PropErty based testing

PropErty Based TestingEnrique Paz @quiquepaz

Rolph de Ruiter

1/10

Page 2: PropErty based testing

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

Page 3: PropErty based testing

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

Page 4: PropErty based testing

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

Page 5: PropErty based testing

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

Page 6: PropErty based testing

Property Based Testing Training Setup

• github.com/spilgames/PropEr@ErlangDCRB13I README.mdI Makefile + rebarI src/ with source and propertiesI test/*_eunit.erl as test controllers

3/10

Page 7: PropErty based testing

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

Page 8: PropErty based testing

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

Page 9: PropErty based testing

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

Page 10: PropErty based testing

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

Page 11: PropErty based testing

Property Based Testing Available Tools

• Open Source• Plenty of documentation• Using & contributing via Github

• Available for multiple languages• Trainings and support (at a price)• Pulse for concurrency issues

5/10

Page 12: PropErty based testing

Hands On! A Property

6/10

Page 13: PropErty based testing

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

Page 14: PropErty based testing

Conclusions A Practical View

• Property Driven Development is not a thingI Thinking properties is hardI Refactoring properties is hardI Manual basic testcases help you think

• Naming is essential• Avoid reimplementating + comparing• PBT finds stuff you’d never think of

8/10

Page 15: PropErty based testing

Conclusions A Practical View

• Property Driven Development is not a thingI Thinking properties is hardI Refactoring properties is hardI Manual basic testcases help you think

• Naming is essential• Avoid reimplementating + comparing• PBT finds stuff you’d never think of

8/10

Page 16: PropErty based testing

Conclusions More Info

• PropEr @github• PropEr Docs• Quickcheck For Erlang• Concuerror @github• Concuerror Presentation

9/10

Page 17: PropErty based testing

Conclusions Questions?

Leave us feedback! http://spkr8.com/t/28341

10/10


Recommended