CheckOps home

Tools directory

S

CheckOps

ScalaCheck

ScalaCheck is a BSD-3-Clause property-based testing library for Scala and Java, inspired by Haskell's QuickCheck, with generators, shrinking and stateful testing, used by ScalaTest, specs2 and MUnit.

Visit website

Latest public signals

Not refreshed yet. Refresh reads the public site and, when the entry has a GitHub repository, the latest release.

Visit Website

Introduction

ScalaCheck is a library for automated property-based testing of Scala or Java programs, inspired by Haskell’s QuickCheck. You state properties as general statements about your code, such as “reversing a list twice yields the original”, and ScalaCheck generates many random inputs to try to falsify them.

Properties are built with forAll, using implicit Arbitrary instances for standard types or custom generators (Gen.choose, Gen.oneOf, Gen.listOf, for-comprehensions over Gen). When a property fails, ScalaCheck shrinks the counterexample to a simpler case. Labels, classifiers and collectors help explain test data distribution, and Commands supports stateful testing of systems against a model. ScalaCheck can run standalone or through integrations with ScalaTest, specs2 and MUnit, and it is maintained under the Typelevel organisation. Version 1.20.0 was released on 27 August 2026.

The source code is at typelevel/scalacheck on GitHub under the BSD-3-Clause licence, with about 2,000 stars; the most recent commit was on 29 October 2026.

Features

  1. QuickCheck for Scala: Generated inputs and shrinking.
  2. Composable generators: Build data with Gen combinators.
  3. Stateful testing: Commands for model-based tests.
  4. Integrations: ScalaTest, specs2 and MUnit.

Pros

  1. Free to use: Open source under the BSD-3-Clause licence, so the core tool costs nothing to use.
  2. Actively maintained: The repository had commits as recent as 29 October 2026.

Cons

  1. Implicit-heavy: Arbitrary instances can be confusing for newcomers.
  2. Writing good properties takes practice.: Weak properties add runtime without much value.
import org.scalacheck.Properties
import org.scalacheck.Prop.forAll
import org.scalacheck.Gen

object PricingProps extends Properties("Pricing") {
  property("discount never increases price") =
    forAll(Gen.choose(0, 1000000), Gen.choose(0, 100)) { (price, pct) =>
      Pricing.apply(price, pct) <= price
    }

  property("reverse twice") = forAll { (xs: List[Int]) => xs.reverse.reverse == xs }
}

Resources:

Pricing

ScalaCheck is free and open source under the BSD-3-Clause licence.

  1. Scala developers adding property-based tests.
  2. Library authors testing algebraic laws and data structures.

Conclusion

ScalaCheck is the foundational property-based testing library for Scala, integrated with all major Scala test frameworks.

Alternatives

Other tools on CheckOps that cover similar ground. Open a page, or compare one with ScalaCheck side by side.