CheckOps home

Tools directory

R

CheckOps

Rapid

Rapid is an MPL-2.0 property-based testing library for Go, inspired by Hypothesis, with automatic shrinking, state machine testing and integration with go test.

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

Rapid is a Go library for property-based testing. Instead of writing individual examples, you describe how to generate inputs and state a property that should always hold, and Rapid checks it against many generated cases. Its design is inspired by Python’s Hypothesis, and it works directly with the standard testing package.

Inside rapid.Check(t, func(t *rapid.T) { ... }) you draw values from generators such as rapid.Int(), rapid.String(), rapid.SliceOf(...) and rapid.Custom(...). When a property fails, Rapid automatically shrinks the input to a minimal failing case without user-written shrinkers, and failing cases can be replayed. State machine testing via t.Repeat generates sequences of actions to test stateful code against a model, and Rapid can also be used to drive Go’s native fuzzing. Version 1.3.0 was released on 30 April 2026.

The source code is at flyingmutant/rapid on GitHub under the MPL-2.0 licence, with about 915 stars; the most recent commit was on 4 September 2026.

Features

  1. Hypothesis-style generators: Composable generators with automatic shrinking.
  2. go test integration: Properties are ordinary Go tests.
  3. State machine testing: Generate action sequences for stateful code.
  4. Reproducible failures: Replay minimised failing cases.

Pros

  1. Free to use: Open source under the MPL-2.0 licence, so the core tool costs nothing to use.
  2. Actively maintained: The repository had commits as recent as 4 September 2026.

Cons

  1. Smaller community: Fewer examples than testify or gomock.
  2. Properties need thought: Good invariants take practice to write.
import (
    "sort"
    "testing"
    "pgregory.net/rapid"
)

func TestSortIsIdempotent(t *testing.T) {
    rapid.Check(t, func(t *rapid.T) {
        xs := rapid.SliceOf(rapid.Int()).Draw(t, "xs")
        once := append([]int(nil), xs...)
        sort.Ints(once)
        twice := append([]int(nil), once...)
        sort.Ints(twice)
        if !equal(once, twice) {
            t.Fatalf("sort not idempotent: %v vs %v", once, twice)
        }
    })
}

Resources:

Pricing

Rapid is free and open source under the MPL-2.0 licence.

  1. Go developers wanting property-based testing with automatic shrinking.
  2. Stateful components tested against a model.

Conclusion

Rapid brings modern, Hypothesis-style property-based testing to Go with minimal ceremony.

Alternatives

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