How to formulate natural language instructions? - iks-gmbh-tools/SysNat GitHub Wiki
There are two very different kinds of styles how tests can be formulated in natural language. Although those two kinds clearly differ, they can be mixed and combined, so that a discrimination may become difficult. Those two kinds are called the Imperative Style and the Declarative Style. Both styles have advantages and disadvantages as shown in the following table.
Some BDD-Testing tools such as JBehave and Cucumber favour the declarative style. To promote this style Gherkin has been put into existence, a tiny DSL that allows to structure test cases and make this structure very readable. Have a look on an example and note that the keywords are highlighted in bold:
In SysNat you can formulate declarative tests with and without these BDD keywords. If you do not like them you can just remove the Given, When, Then and And from the example above. However, Feature and Scenario are still needed as so-called Stage Instructions. Alternatively in SysNat, you can use the imperative style and formulate in this way:
In the last example, the Gherkin Feature is called Behaviour and the Gherkin Scenario is called XXID (short for eXecutable eXample IDentifier). The test case structure is provided here not by Gherkin Given-When-Then but by the Test-Phase stage instructions Arrange-Act-Assert.
It is not a good idea to mix these styles within one file. Decide consciously to formulate strictly your XXs either imperatively or declaratively. However, you can use the advantages of both styles (see table above) by using Natural Language Scripts.