What About the Drawbacks?
Many companies are founded by engineers who had a cool idea and put something together. And a lot of times, extensive testing isn’t a part of that. There are conflicting schools of thought on the best way to implement testing, even within a single organization. And everyone is very passionate about their particular point of view.
It can be hard to get the whole team on the same page. Everyone notices problems with the new thing more than they notice problems with the status-quo — which is typical when you’re implementing any kind of change.
Purism is also a challenge. You get situations where the orthodox approach isn’t necessarily the best one. People aren’t great at recognizing exceptions to rules: they’re either too rigid, not allowing any exceptions at all — or they’ll let anything fly, and everything goes to hell.
Another thing: Cucumber is becoming much more opinionated, and that’s a good thing. I see people who are using Cucumber incorrectly, which causes them to dislike the tool. Historically, it’s given people more than enough rope to hang themselves with. To some extent, that’s true of BDD in general. There are a lot of bad practices and poor implementations out there.
What Obstacles Face BDD Practitioners?
The big one is the question of test data. In an ideal BDD world, tests aren't dependent on existing system state. But in reality, there are often data needs that can't be solved with simple fixtures and factories. For example, data that are retrieved from an external API or generated by a background job. Another issue that becomes a challenge is retrofitting tests to legacy codebases in order to transition to BDD workflows.
In practical terms, I also see test suites become unwieldy when teams skip refactoring their tests (and too often, even their application code). That often leads to the impression that BDD looks good on paper but isn't practical in real life. I think figuring out viable answers to these questions is going to be a critical next step for those of us who would like to see wider adoption of behavior-driven workflows.
Looking to work with trusted partner on your next development project? Speak with a Very team member today