BDD Feature Files & Scenario – Who Writes & When?

September 6th, 2019 | BDD
BDD Feature Files and Scenario

The answer that we often listen for Kanban teams is “When you choose the story”, and for Scrum teams its “during the sprint planning”. The problem that’s associated with these replies is they don’t embrace various factors that may lead to making the adoption difficult or could frustrate the teams. 

To this, if your first reaction is “our testers/QA write them while testing is conducted with Cucumber” then you might wish like thinking whether you are really performing BDD, and is SpecFlow/cucumber/Behat a suitable tool for you. 

Now, if the business analysts/product owner, testers, and developers all are involved in capturing and discussing the examples (i.e scenarios) then let’s see ‘When’ and ‘Who’ questions. 

BDD Feature Files & Scenario

Writing the features files employing Gherkin appears to be simple firstly but, later the writing task may be difficult. Teams often go deep into the discussions of acknowledging the way of writing the steps, linking them to if a step is ‘When’ or ‘Given’. If the writing job of the feature file (capturing the conversation) is performed during the planning of sprint with various people will pop up with input regarding the Gherkin and the conversation gets deflected from the path of User Story discussion utilizing the instances, and then wastes the people’s time by targeting on the Gherkin discussion. 

To halt the session like sprint planning more than 3 participants diving into discussions on writing Gherkin, we encourage the teams to grab the instances from the conversion of the sticky notes employing just 1 or 2 short sentences. It’s easy to tear up the sticky notes and write the new ones at a faster pace when the instances are discovered freshly and refined. These are the real examples of you that will assist the scope of the team and think on the User Stories, in Gherkin, there’s no requirement of any full feature to perform that. 

Employing the sticky notes alters the answers to the ‘when’ query of a phased strategy:

  • Carry out the conversation regarding the User Story employing BDD techniques while Sprint planning is in continuation and jot down the instances on the sticky notes.
  • Take the sticky notes to be scripted into Gherkin when the planning session comes to an end, capturing the moment with a smartphone would be nice. 
  • The written features are shared with the attendees of the meeting to be sure that everything was just embraced. At this stage, we usually find the Gherkin discussion popping up, but it’s less for the mature teams as they move with a settled pattern. 

So, ‘who’ writes the sticky notes into ‘Given When Then’?

One can just discourage the fool reactions to say the “testers, as they are the ones who automate taking along with the cucumber”. While carrying the decision-making part, one needs to monitor the skills of everyone and the time availability inside the team. For some, the product owner will hold the capability, for others, it will be the developers. 

The best strategy we pull out, specifically for the teams new to Behavior Driven Development, is to employ a pair for writing the feature files and the scenarios. The pair blend attracts distinct perspectives to write the scenarios, especially if they belong to distinct roles, and this can lead to the prevention of a lot of ‘Gherkin’ discussions raising to the team level when sharing of a feature file is carried. For onboarding a new member of the team with BDD and Gherkin, the pairing would be a great technique. 

What If one is Not Employing Scrum?

In this instance, one is targeting on Scrum and the sprint planning, but considering other situations, he uses this principle: “ Finish up with the conversation about the User Story as approaching as possible to start working on it”. The reason behind this is that the User Story conversation is a half-life, that’s shared getting the built-up by a team that degrades with time. 

Outside the Scrum, the sticky notes and write-up after the technique are yet applicable, but it can be used only when there exist three or more participants in a discussion. 

Wrapping Lines

When the conversation of the User Story is in continuation, be sure the members target specifically on the discussion and it doesn’t get deviated into a technical one on a backing technique, such as writing instances in gherkin. For capturing the examples, questions, and ideas, sticky notes are great during the conversation without going deep in the path.