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.
Latest public signals
Not refreshed yet. Refresh reads the public site and, when the entry has a GitHub repository, the latest release.
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
- QuickCheck for Scala: Generated inputs and shrinking.
- Composable generators: Build data with Gen combinators.
- Stateful testing:
Commandsfor model-based tests. - Integrations: ScalaTest, specs2 and MUnit.
Pros
- Free to use: Open source under the BSD-3-Clause licence, so the core tool costs nothing to use.
- Actively maintained: The repository had commits as recent as 29 October 2026.
Cons
- Implicit-heavy: Arbitrary instances can be confusing for newcomers.
- Writing good properties takes practice.: Weak properties add runtime without much value.
Usage and Links (Example)
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.
Recommended for?
- Scala developers adding property-based tests.
- 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.
SScalaTestScalaTest is an Apache-2.0 testing toolkit for Scala and Java with many testing styles (FunSuite, FlatSpec, WordSpec and more), rich matchers and integration with sbt, Maven and IDEs.Compare with ScalaCheck
MMUnitMUnit is an Apache-2.0 Scala testing library from Scalameta with a minimal JUnit-based API, actionable error messages with diffs, fixtures and support for JVM, Scala.js and Scala Native.Compare with ScalaCheck
Sspecs2specs2 is an MIT-licensed Scala library for writing executable software specifications, offering unit and acceptance specification styles, matchers and integration with ScalaCheck.Compare with ScalaCheck
HHypothesisHypothesis is the MPL-2.0 property-based testing library for Python: describe the range of inputs, let it generate cases including edge cases, and get the simplest failing example when a property breaks.Compare with ScalaCheck
Jjqwikjqwik is an EPL-2.0 property-based testing engine for the JUnit Platform, letting Java and Kotlin developers write properties with generated, shrinking inputs alongside regular JUnit 5 tests.Compare with ScalaCheck
Ffast-checkfast-check is an MIT-licensed property-based testing framework for JavaScript and TypeScript, with rich arbitraries, shrinking, replayable seeds, model-based testing and race-condition detection.Compare with ScalaCheck