O'Reilly logo

Scala Test-Driven Development by Gaurav Sood

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required