Sometimes I say things that I shouldn’t.
Evolution is what happens when creatures encounter a challenge to their survival. BDD is what has happened now that developers have encountered customers. Yet it isn’t TDD that’s evolved – it’s the developers themselves.
It’s the language which they use, their understanding of delivery and value, and the way in which they use their tools to express it.
That last – the tools – has been the focus of most BDD frameworks. They help, and with enough intelligence and creative application, they can change the language of a project. I’ve heard developers talking together, and customers, overhearing them, step in. I’ve seen newcomers to projects take ownership of stories within their first week, because the code is easy enough to read and understand. I’ve watched them as they’ve argued over the meaning of names, the phrasing of test methods and the responsibilities of their classes.
Mostly, these developers use JUnit, and start all their methods
testShould. Some of them have had to put up with me showing them JBehave, but it isn’t the framework itself that’s changed the way we write code. It’s a natural shift towards an evolutionary advantage; the fluidity of thought and speech that comes with expressing the behaviour and value of the system in English (for some value of English).
The evolution is from this:
The Sheep class is too big and we can’t add the functionality we need. We could split some of the code that manages its position into a SheepPositionService, then make that responsible for keeping it inside Range.min and Range.max. That would help to separate its dependency from Produce outside the Range.
Sheep are too complicated to control. We could stop them from straying if we made a fence, then they wouldn’t eat the crops in the other fields.
If you can think of your code in English, in terms of value rather than requirement, and behaviour rather than functionality, converting it to tech-speak at the lowest possible level and the last possible moment, then you too have evolved.
BDD is still nothing new – some people have been doing it for years. But the evolutionary step is now big enough, and the freakish mutation widespread enough, that it’s worth giving the species a new name.