Scala Hedgehog is a free property-based testing system for Scala. It generates values for checking properties and uses integrated shrinking to simplify failing cases while preserving the invariants of generated values. Range combinators let developers constrain generated numbers and collections. For stateful software such as web services and database layers, it supports abstract state machine testing. The project provides an SBT test runner and integration modules for Minitest and MUnit; its documentation also describes Gradle support through a Scala plugin. Documented Scala versions are 2.12, 2.13, and 3.3 or later. Binary dependencies for its modules are published through Maven Central, and the core module has no external dependencies. The project describes its release as early, so its API may change before wider adoption. IntelliJ's Scala plugin does not list Hedgehog among its built-in supported test frameworks, although Properties tests can be run as applications. SBT 1.9.1 and later support the testing extension by default; older versions require a testFrameworks setting.
Who it is for
Scala developers who want generated property checks or state-machine tests may find Hedgehog useful. It suits teams using SBT, Minitest, or MUnit, with the caveat that IntelliJ does not list it as a built-in test framework.
What is good
- Integrated shrinking preserves generated-value invariants.
- Supports state-machine testing for stateful systems.
- Includes SBT, Minitest, and MUnit integrations.
- Core module has no external dependencies.
What to know first
- The project describes the release as early.
- The API may change before wider adoption.
- IntelliJ does not list Hedgehog as a built-in test framework.
Verdict
Scala Hedgehog offers property-based and stateful testing with shrinking and multiple test integrations. Its early release status and IntelliJ limitation are worth weighing before adopting it.
Scala Hedgehog plans and pricing
All plansCompared on property-based testing tools
- Free plan
- Yes
- Supported languages
- Scala, Java
- Test runner support
- sbt, Minitest, MUnit
- Failing-case shrinking
- Yes
- Stateful testing
- Yes
- Reproducible failures
- Yes
