As I once tweeted, “BDD starts with collaboration, not automation”. Although its output is usually an automated test, its initial purpose is to create a shared understanding.
This is exactly what many people confuse it with – they focus on its output at the end, the automation of acceptance tests. While in reality Behavior Driven Development (BDD) covers a variety of aspects from collaboration through automation. These are:
Below I would like to talk about a few of the common misconceptions:
The behavior of a requirement is often described as “Given some initial state, when some action or event occurs, then there is some output or a change in state”. So artifacts are often written in Gherkin using a Given/When/Then template. However, some frameworks use different styles. For example, Fit/FitNesse uses just tables. The understanding of other requirements, such as business rules, could be described as “This input should produce this output”, so an Excel spreadsheet is often used as the artifact. While the format is not prescribed, the shared understanding is almost always established using examples that illustrate requirements. The examples include sets of values which demonstrate where differences in behavior occurs, such as boundary values.
One of the members of the triad could create the artifact alone, but without sharing it with the other members, the essential joint understanding is missed. A tester could create a test using the Gherkin syntax and automate it, but that is just doing testing, not collaborating. I was at one company where the developers were creating their tests in SpecFlow (C# automation of Gherkin). But the product owner was never shown those tests. That is just doing another form of testing, not BDD.
The collaboration of the triad in BDD and ATDD (Acceptance Test-Driven Development) results in an artifact that represents an unambiguous test of a requirement. The only difference between the two is the BDD emphasizes creating scenarios (Given/When/Then) which become the tests and ATDD focuses on creating testable scenarios. The tests in BDD/ATDD may take hours or days to pass, depending on the size and complexity of a requirement. TDD involves mainly the developer (or developer/tester) in creating tests that describe the responsibilities for the internal parts of an implementation. Tests are created, code is written, and tests pass in a minute or a few minutes.
Since tests are a tangible output of BDD, these tests are often conflated with the process. The tests represent the shared understanding of the requirements, which is achieved through BDD.