« Table of Contents »
Previous « Effective Behaviour Specification Steps
The Behaviour Specification Handbook
Effective Behaviour Specification Steps
Work Backwards: Then-When-Given
Consider writing the Gherkin steps in reverse order.
Write the “Then
” steps first, followed by the “When
” and finally elaborate on the “Given
” steps.
The wording in the “Then
” steps (and also some of the other steps) typically overlaps with part of the Behaviour Specification Description that already has been written.
Starting with “Then
” and copying and pasting the relevant text from the Behaviour Specification Description is a great way to focus on the goal and kick-start the process of specifying that particular behaviour.
Sometimes doing this feels too easy, but it is a sound approach — and no one ever suggested that writing the steps has to be difficult!