Skip to Content
Effective Software Testing
book

Effective Software Testing

by Mauricio Aniche
April 2022
Intermediate to advanced
328 pages
9h 56m
English
Manning Publications
Content preview from Effective Software Testing

5 Property-based testing

This chapter covers

  • Writing property-based tests
  • Understanding when to write property-based tests or example-based tests

So far, we have been doing example-based testing. We judiciously divide the input space of a program (into partitions), pick one concrete example from all the possible ones, and write the test case. What if we did not have to pick one concrete example out of many? What if we could express the property we are trying to exercise and let the test framework choose several concrete examples for us? Our tests would be less dependent on a concrete example, and the test framework would be able to call the method under test multiple times with different input parameters—usually with zero effort from us.

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Effective Software Testing

Effective Software Testing

Mauricio Aniche
The Art of Software Testing, 3rd Edition

The Art of Software Testing, 3rd Edition

Glenford J. Myers, Corey Sandler, Tom Badgett
Software Testing: Principles and Practices

Software Testing: Principles and Practices

Srinivasan Desikan, Gopalaswamy Ramesh

Publisher Resources

ISBN: 9781633439931Supplemental ContentPublisher SupportOtherPublisher WebsiteSupplemental ContentErrata PagePurchase Link