In the first part of my series about Behaviour Driven Development , I will not yet talk about the how , but more about the why . In addition, BDD will be classified in the world of agile methods.
Despite the fact that we had excellently prepared user stories and also consistently test-driven development, we all too often ran into a classic problem of software development: we developed the wrong thing.
At the end of the sprint, in the course of quality assurance and acceptance, we discovered that the developers had completely or partially misunderstood the story. Additional effort had to be expended to correct this error.
In somewhat abstract terms, the process looks like this
This process is so painful because only after the software has been developed can it be determined that not all project participants have the same picture of the software. The already developed software must be changed at great expense. The testing phase is always at risk of causing an explosion of effort.
The experience can be frustrating for all participants
The described problem has occurred again and again in the history of software development and in countless forms. Many probably consider it a law of nature. Accordingly, there are a variety of strategies to avoid or at least alleviate this pain. Many of these strategies involve getting feedback as early as possible.
A classic technique to get early feedback during software development is test-driven-development (aka TDD). The developer writes the test first, then the actual software. The resulting unit tests thus first serve the development and from then on as regression tests. TDD is a core component of BDD as we will see later.
The most direct feedback is offered by Pair Programming where the developer gets feedback from his colleague while writing the code. See the articles by Guido (link) and Robert (link
Another strategy is to publish the result of the development as early as possible and as often as possible in order to be able to recognize an erroneous development as early as possible by the feedback of the testers and users. (http://en.wikipedia.org/wiki/Release_early,_release_often). A possibility this to convert is the development in iterations: Instead of developing a software project over months, then publishing and the feedback of the customer to wait, we divide the work into iterations.
Examples of iterative methods are the sprints in Scrum or the releases in Feature Based Programming After an iteration of maybe 2 or 3 weeks, a part of the software is published and released for testing and use.
In an iterative approach, the promise is that only work of one iteration length (e.g., 2 weeks) can go in the wrong direction. Accordingly, the above-described erroneous developments still exist. In particular, if one does not examine the project progress after each iteration accordingly exactly and test for regressions.
Following the same reasoning, months or years of work can be at risk in classic projects. In the worst case, it turns out that the requirements can no longer be met and a project fails.
The concept of Continuous Delivery, as we operate it at Otto, goes a big step further. Every commit of a developer can, in principle, go live. Ideally, this happens several times a day. In reality, maybe every 2 days. So instead of collecting the changes to the software over weeks and putting them live all at once, you try to do as many and as small deployments as possible. A nice side effect is that with each release, only a very small change goes live. If an error is discovered in a release, it can be narrowed down accordingly and corrected in a targeted manner. Even a rollback that may become necessary loses its horror and becomes easier to manage.
Continuous Delivery is a holistic approach and a highly complex task. One of the technical hurdles we had to overcome is described by Guido in his article about Blue-Green-Deployment one of the problems in development in his article about Feature Toggles (link).
Actually, however, you want to exclude errors in production before deployment. Continuous Delivery is therefore only possible if there is a high level of trust in the quality of the delivered software. This confidence can only be established by a suitable development process, and must be secured in this by automated tests.
There are two important requirements on the Build process, which must be fulfilled, before one can think of it at any time and often to be able to be deployed
This is where Behaviour Driven Development comes into play. It makes two very important contributions
We have received your feedback.