Chapter 7.  Property-Based Testing

Sometimes, to make our tests exhaustive, we need to test against as many of the test cases as possible. Writing a test for each testable input obviously cannot be the answer. Property-based testing framework executes the same test over and over with generated input. This can easily be contrasted with the traditional example-based testing, which has a unit test depicting a sample scenario with test data that is descriptive of that scenario. This chapter will cover the following topics:

  • Property-based testing
  • Table-driven property checks
  • Generator-driven property checks
  • ScalaCheck

Introduction to property-based testing

In modern software development gauge, tests are the measure of the quality of your software. It is ...

Get Scala Test-Driven Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.