My experience of the CukeUp 2016 BDD conference
Date posted
19 April 2016
Reading time
15 Minutes
My experience of the CukeUp 2016 BDD conference
Perhaps the simplest short description that I have come across to describe Behaviour-Driven Development is by Margaret Rouse:
'Behaviour-driven development (BDD) is a software development methodology in which an application is specified and designed by describing how its behaviour should appear to an outside observer. A typical business application project would begin by having stakeholders offer concrete examples of the behaviour they expect to see from the system. All coding efforts are geared toward delivering these desired behaviors. The real-life examples gleaned from stakeholders are converted into acceptance criteria with validation tests that are often automated. The results of these tests provide confidence to stakeholders that their desired business objectives for the software are being achieved.' (http://searchsoftwarequality.techtarget.com/definition/Behavior-driven-development-BDD)Over the past year and a half, I have been reading about and using BDD tools, and have recently introduced some BDD tools and practices into Digital Transformation projects in Kainos. The experience of using BDD tools like SpecFlow to facilitate outside-in development and TDD has brought great benefits to the quality of the development process as well as new learnings for myself and my colleagues who have been involved in these projects. But reading and experimenting can only take us so far personally, I needed to understand more about what other BDD practitioners are doing so that I could see where I can improve and can better contribute towards BDD practices in Kainos as this fantastic software development methodology grows in popularity and becomes more of a common standard in software development communities. So thanks to Kainos, I was lucky enough to have the opportunity to attend 'CukeUp! 2016 - the progressive BDD conference for testers, developers and product owners'. As well as being the first tech conference I've ever had the good fortune of attending, I also landed up (unexpectedly!) speaking at the conference. The event consisted of two full days packed with interesting and informative talks and workshops relating to various aspects of BDD. Speakers included world renowned contributors to the technologies and practices of BDD, including Aslak Helles??y, the creator of Cucumber, and Gasper Nagy, the creator of SpecFlow BDD tools used by tens of thousands of developers world-wide. I couldn't possibly sum up all the content of the workshops and talks that I attended so I'll summarise a few of the key points that resonated with me.
Not all tests that can be automated should be automated. Sometimes an eye-over is enough.
One of the speakers recounted examples of where significant and costly development effort had gone into automating aspects of certain tests that were unlikely to be affected by change, often and could have been, simply and quickly checked manually whenever common sense and a bit of process management dictated that these aspects may be affected. In retrospect, they could have saved themselves a lot of effort had they exercised more moderation in their levels of test automation.Keep it 'hidden in the given'
In BDD, system behaviours are specified in user stories that are broken down into multiple scenarios which define the behaviour of the system. Each scenario is broken down into 3 blocks;- 'Given' the initial conditions assumed to be true at the beginning of the scenario
- 'When' the event that triggers the scenario
- 'Then' the expected outcome of the scenario
Describe the behaviour, not the implementation
To truly gain the benefits of BDD, one should describe the behaviour of the system without any reference to how the behaviour is implemented. This means that the behaviour is decoupled from the implementation in terms of how it is designed and therefore prevents both technical and non-technical stakeholders from jumping to solution too early. For example, consider the following scenario: Scenario 1: Refunded items should be returned to stock Given that a customer previously bought a black sweater from me And the number of black sweaters in stock on the stock page is 3 And I have selected the black sweater from the return item type drop down list When I click the return item button Then the number of black sweaters in stock on the stock page should be 4 Now consider this re-written version of the same scenario: Scenario 1: Refunded items should be returned to stock Given that a customer previously bought a black sweater from me And I have three black sweaters in stock. When he returns the black sweater for a refund Then I should have four black sweaters in stock. The second example demonstrates how the behaviour can, and should, be described without any reference to how the behaviour is implemented in the system. This is far easier to read in terms of building and maintaining living documentation that describes the behaviour of the system independent of its implementation. This, in turn, supports the good advice of another speaker, Dirk Rombauts. He said that we should avoid anything that;- Reduces involvement of team members
- Creates information overload
- Reduces outside-in development