ScalaCheck

ScalaCheck libraries are used for Generator-driven, property-based testing. ScalaCheck can be used for testing both Java and Scala. ScalaCheck is written in Scala and was inspired by QuickCheck for Haskell.

It is quite easy to introduce ScalaCheck in you is test harness, as it only needs Scala to work with and is not dependent on any other external libraries.

Note

To include ScalaCheck in your application test harness, add this line to your build.sbt file:

libraryDependencies += "org.scalacheck" %% "scalacheck" % "1.13.0" % "test"

For an in-depth view of ScalaCheck, check out, http://www.artima.com/shop/scalacheck.

Generators

ScalaCheck uses Generators for creating test data. Quite simply put, a Generator is a function that takes some parameters ...

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.