Rapid is a Go library for property-based testing.
Rapid checks that properties you define hold for a large number of automatically generated test cases. If a failure is found, rapid automatically minimizes the failing test case before presenting it.
Property-based testing emphasizes thinking about high level properties the program should satisfy rather than coming up with a list of individual examples of desired behavior (test cases). This results in concise and powerful tests that are a pleasure to write.
- Idiomatic Go API
- Automatic minimization of failing test cases
- No dependencies outside of the Go standard library
- Automatic persistence of failing test cases
Rapid aims to bring to Go the power and convenience Hypothesis brings to Python.
Compared to gopter, rapid:
- has a much simpler API (queue test in rapid vs gopter)
- does not require any user code to minimize failing test cases
- uses more sophisticated algorithms for data generation
Compared to testing/quick, rapid:
- provides much more control over test case generation
- supports state machine ("stateful" or "model-based") testing
- automatically minimizes any failing test case
- has to settle for
rapid.Checkbeing the main exported function instead of much more stylish
Rapid is alpha software. Important pieces of functionality are missing; API breakage and bugs should be expected.
If rapid fails to find a bug you believe it should, or the failing test case that rapid reports does not look like a minimal one, please open an issue.
Rapid is licensed under the Mozilla Public License version 2.0.