hegel
Hegel: Property-Based Testing
Hegel is a family of property-based testing libraries supporting multiple languages, powered by Hypothesis. Tests integrate with standard language test runners. Hegel generates random inputs for your code and automatically shrinks failing cases to minimal counterexamples.
Even when PBTs add modest line coverage over unit tests, their value is in exercising combinations and boundary conditions that humans don't think to write by hand.
Code examples in this file use Python-like pseudocode to illustrate concepts. For exact API and syntax, load the language-specific reference (see step 1 of the workflow).
Workflow
Follow these steps when writing property-based tests.
1. Load the Language Reference
Determine the project language and load the corresponding reference from references/<language>/reference.md for API details and idiomatic patterns.
2. Explore the Code Under Test
Before writing any test, understand what you're testing: