The concept for a RIDDL Examples is very similar to Dan North’s Gherkin Examples. Gherkin has been used for many years to specify test cases that serve as functional specifications as well. Gherkin is simple enough for anyone to understand them.
In RIDDL this idea is used to specify the functionality for any of the vital definitions. An Example is structured like this:
- SCENARIO identifier - provides the name of the example or scenario (optional)
- GIVEN condition (optional)
- WHEN condition (optional)
- THEN action
- ELSE action (optional)
The intent here is to express how in the context of some circumstance (GIVEN), when a particular thing happens (WHEN), take some action (THEN), otherwise, in that context, if that thing does not happen take some other action (ELSE).
Since four of those things are optional, it often just comes down to THEN.