typelevel/scalacheck
59.4
Adequate · 27 September 2026
5.8k
lines of production code
Scala
primary language
4
measurements over time
What this system is
This system is the ScalaCheck library, a property-based testing framework for Scala that generates test data and verifies system properties. It provides core capabilities for creating generators and shrinkers across multiple Scala versions (2.12, 2.13, and 3) and platforms (JVM, Scala.js, and Scala Native). The library also supports stateful testing through a Commands API and includes utilities for parallel execution, command-line reporting, and performance benchmarking.
How it got here
2007–2014 — Modularization and cross-platform expansion
9 changes.
The project underwent a significant architectural refactoring to split the core library into modular components for generation, properties, and testing. Concurrently, the build infrastructure was modernized to support Scala 3, Scala.js, and Scala Native, while extensive example projects were added to demonstrate usage with various technologies and stateful testing scenarios.
2019–2022 — Scala 3 migration and platform expansion
13 changes.
The project underwent a significant core rewrite to support Scala 3, introducing new generator capabilities and refined shrinking behavior. This period also expanded platform support to Scala.js and Scala Native, added comprehensive Java Time type support, and implemented a new stateful testing API alongside extensive test coverage.
Features
Add Commands LevelDB example with property-based tests
The commands-leveldb example now includes a property-based test specification for LevelDB operations. This adds a new test suite (CommandsLevelDB.scala) that defines commands for opening, closing, putting, and getting data from a LevelDB instance, along with the necessary build configuration (shell.nix) and gitignore rules to support the example.
examples/commands-leveldb · high confidence
Add Redis commands property-based testing example
A new example project has been added to demonstrate property-based stateful testing of a Redis database using ScalaCheck's Commands API. The example includes a test suite that models Redis state and verifies postconditions for commands such as Set, Get, Del, FlushDB, DBSize, and connection toggling, along with documentation on how to run the tests against a local Redis server.
examples/commands-redis · high confidence
Add Scala 2.13+ specific support for LazyList and Java collections
This change introduces version-specific implementations for Scala 2.13+ to support \LazyList\ generation and shrinking, and to provide \Buildable\ instances for \java.util.ArrayList\ and \java.util.HashMap\. Users can now generate and shrink \LazyList\ values and use Java utility collections within ScalaCheck generators and shrinkers on Scala 2.13+.
core/shared/src/main/scala-2.13+ · high confidence
Add Scala.js and Scala Native platform implementations
New platform-specific \Platform.scala\ files have been added for the Scala.js and Scala Native targets. These implementations provide the necessary runtime support for reflective instantiation and worker execution, enabling the library to function correctly on these non-JVM platforms.
core/js, core/native · high confidence
Added generator benchmarks for performance testing
A new benchmark suite (GenBench) has been added to measure the performance of ScalaCheck generators. It uses JMH to benchmark operations such as \const\, \choose\, \option\, \either\, \listOf\, \identifier\, \asciiPrintableStr\, \arbitrary\, \sequence\, \oneOf\, \zip\, \mapOf\, \frequency\, and \filter\ under controlled seed and size parameters to ensure consistent and fair comparisons.
bench/src · high confidence
Added support for generating, shrinking, and hashing Java Time types
ScalaCheck now provides built-in Arbitrary, Choose, Cogen, and Shrink instances for \java.time\ types, including Duration, Instant, LocalDate, LocalTime, LocalDateTime, MonthDay, ZoneOffset, ZoneId, OffsetTime, OffsetDateTime, Period, YearMonth, and ZonedDateTime. This allows users to directly use these standard Java time classes in property-based tests without needing to define their own generators or shrinkers.
core/shared/src/main/scala/org/scalacheck/time · high confidence
Initial project scaffolding and configuration
This change introduces the foundational configuration files for the ScalaCheck project, including \.gitignore\ to exclude build artifacts and IDE folders, \.scalafmt.conf\ to enforce code formatting rules (version 3.11.5, Scala 2.13/3 dialects), and \.scala-steward.conf\ to define build roots for automated dependency updates. It also adds \.git-blame-ignore-revs\ to filter out formatting commits from blame history, along with initial documentation files (\README.markdown\, \CHANGELOG.markdown\, \CONTRIBUTING.markdown\) and the \LICENSE\ file.
(repo-wide) · high confidence
Introduce stateful testing API for ScalaCheck
Adds the \Commands\ trait to the \org.scalacheck.commands\ package, providing a new API for stateful property-based testing. This feature allows users to define abstract states, system-under-test proxies, and command sequences with pre- and post-conditions, including support for parallel execution via \threadCount\ and specialized command types like \SuccessCommand\ and \UnitCommand\.
core/shared/src/main/scala/org/scalacheck/commands · high confidence
Introduces JVM-specific platform abstraction for parallel test execution
A new \Platform\ object has been added to the JVM core module, providing the underlying infrastructure for running property tests in parallel. This implementation introduces a \runWorkers\ method that utilizes a fixed-size thread pool to execute test workers concurrently, merging their results based on success, discard, and exhaustion criteria. It also includes utility methods for dynamic class instantiation and module loading, enabling the testing framework to leverage JVM-specific concurrency features.
core/jvm/src/main · high confidence
New NixOS integration example for testing server networks
Added a new example project in \examples/commands-nix\ that demonstrates how to use ScalaCheck's Commands API to property-test entire networks of virtual machines running on NixOS. The example generates a network of 1 to 4 nodes, booting them via libvirt/QEMU and executing commands like \Boot\ and \Ping\ to verify network connectivity and state transitions. It includes the necessary NixOS configuration modules (\common.nix\, \qemu-module.nix\, \qemu-network.nix\) to define machine parameters (memory, kernel version) and networking (VDE sockets), along with Scala test code (\CommandsNix.scala\) that orchestrates the VM lifecycle and SSH-based command execution.
examples/commands-nix · high confidence
New internal utility library for command-line parsing, reporting, and data formatting
ScalaCheck introduces a new set of internal utility classes in the \org.scalacheck.util\ package to support its testing infrastructure. This includes a \CmdLineParser\ for handling command-line arguments, a \ConsoleReporter\ to print test results to the console, and a \Pretty\ module for formatting test data, arguments, and results with configurable verbosity. Additionally, \Buildable\ provides implicit builders for standard collections like \ArrayList\ and \HashMap\, while \FreqMap\ offers an immutable frequency map for tracking test data distribution.
core/shared/src/main/scala/org/scalacheck/util · high confidence
Architecture
Refactoring of ScalaCheck core library structure
The single source file ScalaCheck.scala has been deleted and split into separate modules for Generation (Gen.scala), Properties (Prop.scala), and Testing (Test.scala). This change reorganizes the library's internal structure to separate concerns, moving generator combinators and implicit definitions into the Gen module, while isolating the testing logic and result handling into the Test module. Users will see no functional change in behavior, but the codebase is now modularized for easier maintenance and extension.
src/scalacheck · high confidence
Behavioural changes
Added Scala 2.12-specific compatibility shims and Java interop builders
This change introduces version-specific source files for Scala 2.12 to maintain compatibility with older Scala versions. It provides a \ScalaVersionSpecific\ object that aliases \LazyList\ to \Stream\ and adds extension methods for \Stream\ and \Sorted\ collections to mimic Scala 2.13+ behavior. Additionally, it adds \BuildableVersionSpecific\ implementations to support building \java.util.ArrayList\ and \java.util.HashMap\ instances, along with \SerializableCanBuildFrom\ instances for standard collections, ensuring proper serialization and builder support in the 2.12 environment.
core/shared/src/main/scala-2.12- · high confidence
ScalaCheck core library rewritten for Scala 3 with new generators and shrinkers
The core ScalaCheck library in this location has been significantly updated, primarily to support Scala 3 (evidenced by the \open\ modifier on \Properties\ and usage of Scala 3 syntax like \ScalaVersionSpecific\). This update introduces new generator capabilities, including \Gen.nonEmptyStringOf\ and \Gen.pick\ (with fixes to ensure it produces all possible combinations), and adds \Cogen\ instances for \SortedSet\ and \SortedMap\. It also refines shrinking behavior by ensuring the original exception is preserved during shrinking and fixing a wrong match in the shrinker. The \Prop\ implementation now matches on \NonFatal\ instead of \Exception\ for better error handling, and the \Test\ parameters now include \useLegacyShrinking\ and \maxRNGSpins\ options to control test execution and RNG behavior.
core/shared/src/main/scala/org/scalacheck · high confidence
Test coverage
Added Scala 2.12-specific test helpers for time type orderings; Added Scala 2.13+ specific test file for Ordering instances; Added Scala.js example project with documentation; Added comprehensive test specifications for ScalaCheck core components; Added minimal ScalaCheck sbt example project; Expanded test coverage for ScalaCheck core components.
Dependencies
Build infrastructure updated to sbt 1.13.0 with Scala.js 1.22.0 and Scala Native 0.5.12
The project build has been upgraded to use sbt 1.13.0, along with significant updates to the cross-compilation toolchain: Scala.js is now at version 1.22.0 and Scala Native at 0.5.12. The build configuration also includes sbt-jmh 0.4.8 for benchmarking and sbt-typelevel 0.8.7 for release management. A new CustomHeaderPlugin has been introduced to manage license headers, and a code generation script (codegen.scala) is now part of the build to automatically generate Arbitrary instances for tuples and functions.
project · high confidence
Upgrade to ScalaCheck 1.20 and modernize build infrastructure
The project has been upgraded to version 1.20, updating the core Scala versions to 2.12.21, 2.13.18, and 3.3.8. The build system has been migrated to the sbt-typelevel framework, which standardizes CI workflows via GitHub Actions and configures binary compatibility checks (MiMa) against versions 1.14.0 through 1.15.4. Additionally, the library now officially supports cross-compilation to Scala Native, and example projects have been updated to use Scala 3.1.3 and ScalaCheck 1.15.4.
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
This is the PUBLIC form of this artifact. Findings are listed in full, but the details of SECURITY findings — which rule fired, in which file, on which line, and how to fix it — are deliberately withheld, and any secret-scanner results are excluded entirely. Where detail is absent here it was REMOVED FOR PUBLICATION; it is not missing from the analysis. The complete artifact is available from the repository owner.
Score
- CAI 33 → 59 (+26.6)
- Rubric changed (rubric-2026.08.15 → rubric-2026.09.15) — scores are not directly comparable.
Lenses
- Code Health 100 → 96 (-4.3)
- Architecture 100 (new)
- Maturity 35 → 50 (+15.2)
- Readiness 23 → 53 (+30.7)
- Security 30 → 70 (+39.6)
Resolved (40)
- Dimension evaluation failed
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- …and 20 more
New (56)
- Choose.chLng (cognitive 20) (core/shared/src/main/scala/org/scalacheck/Gen.scala)
- Choose.chLng (cyclomatic 16) (core/shared/src/main/scala/org/scalacheck/Gen.scala)
- Commands.actions (cognitive 27) (core/shared/src/main/scala/org/scalacheck/commands/Commands.scala)
- Documentation: no installation or build instructions (bench/README.markdown)
- Documentation: no usage examples (bench/README.markdown)
- Duplicated block (27 lines × 2) (core/js/src/main/scala/org/scalacheck/Platform.scala)
- FileTooLong: scalacheck/Gen.scala (core/shared/src/main/scala/org/scalacheck/Gen.scala)
- FileTooLong: scalacheck/Prop.scala (core/shared/src/main/scala/org/scalacheck/Prop.scala)
- FixmeComment (core/shared/src/main/scala/org/scalacheck/Gen.scala)
- FixmeComment (core/shared/src/main/scala/org/scalacheck/Gen.scala)
- Further orphaned files (smaller)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- …and 36 more
Changes since last survey
- 7 commits — 7 feature/other, 0 fixes
By area
- (repo) — 2 commits
- (root) — 2 commits
- examples/commands-leveldb — 2 commits
- .github/workflows — 1 commit
Notable commits
- change: Add .scala-steward.conf
- change: Merge pull request #1201 from xuwei-k/steward-build-roots
- change: Merge pull request #1202 from xuwei-k/patch-1
- change: Regenerate GitHub Actions workflow
- change: Update sbt, scripted-plugin to 1.13.0
- change: Update scala3-library_sjs1_3 to 3.1.3
- change: Update tlBaseVersion
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
typelevel/scalacheck was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 27 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit c2861c71d7a4fd2d8ca742919fee4dba6c92af4c — the exact code this score is about.
- Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-d00c643c3f66.