I’m a big fan of TDD. BDD has always been a bit elusive to me in the sense that I wish I could use it more often. However, I always seem to end up struggling to express the same nuances through BDD that come effortlessly through a standard test case.

Truth be told, I have’t touched BDD in a while. However, this question has been bouncing around my head lately:

Why is it often so difficult to express simple systems through BDD?

Code based tests are really good at describing how we complete a task. BDD is really good at describing what a task is trying to achieve. After thinking about it, I came to the conclusion that the fundamental problem is state:

BDD doesn’t do a good job of being able to access and describe state in the same way we can with code. So the abstraction gap becomes too great when describing the behavior of algorithms and lower-level functionality.

#go #testing #tdd #bdd #golang

An Alternative Approach to BDD in Go
1.90 GEEK