CheckOps home

Tools directory

S

CheckOps

specs2

specs2 is an MIT-licensed Scala library for writing executable software specifications, offering unit and acceptance specification styles, matchers and integration with ScalaCheck.

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

specs2 is a library for writing executable software specifications in Scala, created by Eric Torreborre. It emphasises specifications that read as documentation: acceptance specifications mix narrative text with examples, while unit specifications use a familiar "should" >> { ... } nesting style.

specs2 includes a rich matchers library (must_==, must beSome, must contain, must throwA), concurrent execution of examples by default, contexts for setup and teardown, tags, data tables for parameterised examples, and ScalaCheck integration for properties. Specifications can generate HTML or Markdown documentation, and it integrates with sbt, Maven, IDEs and JUnit runners. specs2 supports Scala 3 in its 5.x series; release SPECS2-5.10.0 was published on 11 September 2026.

The source code is at etorreborre/specs2 on GitHub under the MIT licence, with about 735 stars; the most recent commit was on 29 October 2026.

Its long-standing user guide documents each feature with runnable examples, and specs2 can also be run from JUnit-compatible tooling for CI reports.

Features

  1. Executable specifications: Narrative acceptance specs with examples.
  2. Matchers: Extensive must matchers.
  3. Concurrent examples: Examples run concurrently by default.
  4. ScalaCheck integration: Property-based examples.

Pros

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

Cons

  1. Smaller community: Less widely used than ScalaTest or MUnit.
  2. Learning curve: Acceptance specification syntax takes time.
import org.specs2.mutable.Specification

class PricingSpec extends Specification {
  "Pricing.apply" should {
    "apply a discount" >> {
      Pricing.apply(100, 10) must_== 90
    }
    "reject negative prices" >> {
      Pricing.apply(-1, 0) must throwA[IllegalArgumentException]
    }
  }
}

Resources:

Pricing

specs2 is free and open source under the MIT licence.

  1. Scala teams that value specifications as documentation.
  2. Projects with acceptance-style specs mixing prose and examples.

Conclusion

specs2 is a thoughtful Scala specification library, best for teams that want tests to double as readable documentation.

Alternatives

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