DEV Community

Discussion on: Requirements as code v1.0.0 published

Collapse
 
bertilmuth profile image
Bertil Muth

Hi Pronab,
the requirements are stated in the model.
Take this snippet from the Hello World example from the main page:

Model model = 
  Model.builder()
    .user(RequestHello.class).system(this::displayHello)
    .user(EnterName.class).system(this::displayName)
  .build();

You can read this as:
When the user requests hello, the system displays hello.
When the user enters a name, the system displays a name.

You can also specify a condition, as explained in Step 1 on the main page. That's the typical form of a functional requirement:
Given that a condition is fulfilled, when an event happens, then execute a certain system reaction.

You can also specify flows of user interactions in the model, similar to a state machine. You find examples here.