typelevel / scalacheck

Property-based testing for Scala

Website GitHub


Join the chat at https://gitter.im/scalacheck/Lobby

Build Status

ScalaCheck is a library written in Scala and used for automated property-based testing of Scala or Java programs. ScalaCheck was originally inspired by the Haskell library QuickCheck, but has also ventured into its own.

ScalaCheck has no external dependencies other than the Scala runtime, and works great with SBT, the Scala build tool. It is also fully integrated in the test frameworks ScalaTest and specs2. You can of course also use ScalaCheck completely standalone, with its built-in test runner.

ScalaCheck is used by several prominent Scala projects, for example the Scala compiler and the Akka concurrency framework.

For more information and downloads, please visit http://www.scalacheck.org

Developing ScalaCheck

ScalaCheck is developed using SBT.


To run ScalaCheck's benchmarks, run the following command from SBT:

bench/jmh:run -wi 5 -i 5 -f1 -t1 org.scalacheck.bench.GenBench.*

The required parameters are:

  • -wi the number of warmup intervals to run
  • -i the number of benchmarking intervals to run
  • -f the number of forked processes to use during benchmarking
  • -t the number of threads to use during benchmarking

Smaller numbers will run faster but with less accuracy.

For more information about how we benchmark ScalaCheck, please see the comments in GenBench.scala.