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

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

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