How AI Agents Are Making BDD More Valuable Than Ever
Yadda 3.0.0: BDD in the Age of AI Agents
Stephen Cresswell releases Yadda 3.0.0, a modernized BDD library for JavaScript, and reveals that Claude Code with Opus 4.8 wrote most of the code. He argues that executable specifications are becoming crucial for AI agents, which can generate and verify them cheaply, turning BDD into a contract between humans and machines. The update also adds TypeScript definitions and GitHub-flavored Markdown support.
The natural language gives agents rich domain context, while the executable steps ensure that the specification remains grounded in the behaviour of the system.
- sroerick
I hadn't heard of BDD before, but the idea of "executable spec" is certainly very interesting
- wesselbindt
So, I get the idea of having a layer of abstraction between your tests and the system under test. You decouple _what_ is being done from _how_ it is done, which leads to robust, easily maintained, and even more re-usable test suites. I've seen it in action, it's a great idea, I've reaped the benefits myself. Great stuff.
What I've never really understood is why some people choose natural language for the abstraction. It just seems like such an odd and expensive choice. Most of the layers of abstraction we add in our codebase are written in the programming language of choice itself, they're functions, classes, what have you. But for this one specific flavor of abstraction, folks reach for natural language.
The one potential benefit I could think of for this over a more standard DSL is that non-technical colleagues would be able to read or even write these specs. But in practice I've only seen this pan out once in my life, and that was with a more traditional DSL rather than natural language.
Is there a hidden benefit I'm overlooking?
- jesol
I also think BDD is a really powerful tool for UI acceptance tests! I've now worked on adding it to two AI codebases (one engineered, another vibecoded), and so far it has been mostly positive. Having non-engineers be able to see what effects their code changes have in the UI is nice; and I find having high level API and UI tests is forcing the first layer of cleanup (standardize access to DB through models/services, and a single API SDK).
I am also really interested in standardizing the REST interface with typespec, and the database schema with DBML. I think creating these closed-loops with high-level specs is one of the best ways to make an AI project ownable by a team.