All You Need to Know About Behaviour-Driven Software
For our first article, we had no doubt that we should give our readers some basic info on what exactly behaviour-driven development really is. We will try to keep it as casual as possible, in case you are not that much of a technical person yourself. Still, the subject is rather complex, so we cannot guarantee that you will not see some technical phrases and references. For a full overview of behaviour-driven development, you can find a variety of dedicated websites, including this very helpful Wikipedia article.
What Is Behaviour-Driven Development?
Behaviour-driven development (or BDD for short) emerged from the process known as test-driven development (TDD). The concept behind BDD is to provide development and management teams with a shared process and shared tools, so that they can effectively collaborate while developing software. To this end, it combines the basic principles of TDD with object-oriented analysis and domain-driven design, to make the process of creating software as optimized and effective as possible.
In its core, BDD is simply the idea that software development should be governed by both technical proficiencies and business interests alike. However, besides the ideological concept, BDD does make use of specialized software in order to achieve the desired goals. The main tool of the method is simple domain-specific language (also known as DSL). Instead of complex lines of code, this language uses normal English words and logical constructs to express how the software should behave.
History & Development
As we already mentioned, BDD is a branch of the test-driven development method, which also uses domain-specific language to convert natural language phrases and statements into executable tests. We are talking about sentences that start with a conditional word (should, given, when, if, etc.) and define an outcome. For example:
If I have two apples
And my friend takes one
Then I will have one apple
Using this as a starting point, many people and organisations developed BDD development frameworks over the years. In 2009, Dan North coined the most widely accepted definition of behaviour-driven development:
‘BDD is a second-generation, outside-in, pull-based, multiple-stakeholder, multiple-scale, high-automation, agile methodology. It describes a cycle of interactions with well-defined outputs, resulting in the delivery of working, tested software that matters.’
Basic Principles of BDD
BDD follows the basic principle that each unit of software must be individually tested. The process usually goes like this:
- A test is designed for the specific software unit
- The test is made to fail
- The unit is then implemented into the test
- The test is done again, verifying that the implementation of the unit makes it succeed
This basic outline is perfect, because it allows the testing of both high and low-level software, as well as anything in between. When using the BDD methodology, the tests should be specified in terms of the desired behaviour of the unit in question. This behaviour is basically the requirements set by the business entity that commissioned the creation of the software. BDD is a pretty well-rounded concept, but the developments in the field continue to this day. Make sure you check back often for the latest news about this great software development method.