In the previous post, I described the tradeoffs of using a BDD test automation framework without the full BDD process. But, what about the opposite? What if a team wants to adopt BDD practices without a test framework to support it? Again, behavior-driven practices are beneficial apart from automation, but not without shortcomings.
The Power of Process
BDD should be a refinement, not an overhaul, of Agile software development. All of the problems BDD solves are simply aspects of the development process that must be solved anyway. BDD simply provides formal practices for solving them uniformly. Consider how BDD addresses the following problems:
Problem | Solution |
---|---|
Biz, dev, and test roles are siloed and do not talk together much. | BDD brings these three roles together in Three Amigos meetings. |
Acceptance criteria are missing or poorly defined, wasting in-sprint time. | Acceptance criteria are formalized as specifications using Gherkin. |
Product features are hard to explain. | Scenarios describe individual behaviors in plain language. |
Team members have open questions or conflicting views about behaviors. | Example Mapping efficiently unifies a team’s understanding and identifies areas for further refinement. |
Edge cases are overlooked during testing. | Well-defined behavior scenarios capture specifications by example early in development. |
All of these problems can be solved through better, behavior-driven practices, and none of them pertain to test automation.
Spec-Less Automation
BDD process improvements don’t necessarily need a BDD framework for test automation. Any test framework could still automate scenario steps. The major difference is that there would be no mechanism to translate Gherkin lines into method/function calls: The automation engineer would simply need to program test cases the “good old-fashioned way.” It would not be much different from translating any other procedure-driven test cases into code.
The weakness of this approach is that specifications are not strongly linked to the test automation. The end-to-end development process is less efficient because behavior scenarios must essentially be rewritten into automation code, rather than becoming part of the automation code. There is also a higher risk that automated test cases won’t cover the actual intention of the test steps. Review and maintenance are more difficult because engineers must always cross-examine the automation code with the Gherkin to make sure they align. All of these problems make it harder to shift left with QA work.
The lack of a behavior-driven test framework is also a double-edged sword for Gherkin steps. On one hand, steps do not need to be scrutinized as strongly in review, since automation code does not directly depend upon them. It is not critical to reuse steps word-for-word or to worry about parameterization. However, sloppy steps can lead to miscommunication and will make adopting a BDD test framework in the future very difficult.
Better Than Nothing
Just like for automation without collaboration, using BDD practices without using a BDD test framework does improve the development process. There aren’t really any disadvantages because the process problems must be solved anyway. A “BDD‑‑;” situation (that’s a postfix decrement, to denote that automation did not follow collaboration) isn’t ideal, but at least it’s better than nothing.
3 comments