The testing strategies RegelRecht uses, led by Gherkin BDD scenarios run with cucumber-rs.
RegelRecht uses multiple testing strategies to ensure correctness.
The primary testing approach uses Gherkin feature files executed by cucumber-rs.
Located in features/, these describe expected law behavior. Use the step phrasings the cucumber-rs suite actually defines (packages/engine/tests/bdd/steps/); a minimal scenario looks like:
Laws that need source data (BRP, Belastingdienst, etc.) provide it with data-table steps such as Given the following RVIG "personal_data" data:. See features/zorgtoeslag.feature for a complete, data-driven example.
Test scenarios are derived from the Memorie van Toelichting (MvT), the explanatory memorandum that accompanies Dutch legislation. The MvT contains examples and reasoning from the legislature that serve as ground truth for expected behavior.
Rust unit tests cover the engine internals:
All law YAML files are validated against the JSON schema:
Performance benchmarks using Criterion:
An exploration by Bureau Architectuur of the Dutch Ministry of the Interior into the possibilities of transparent, executable legislation.
Bureau Architectuur
Ministry of the Interior and Kingdom Relations