Yadda 3.0.0:AI 智能体时代的 BDD
Yadda 3.0.0: BDD in the Age of AI Agents

原始链接: http://www.stephen-cresswell.com/2026/08/15/Yadda-3.0.0-BDD-in-the-Age-of-AI-Agents.html

Yadda 3.0.0 现已发布。该版本对这一老牌 JavaScript BDD 库进行了现代化升级,移除了陈旧依赖,全面采用 ES6 并增加了对 TypeScript 的支持。值得注意的是,此次更新几乎完全由 Claude Code 完成,这证明了在周密的阶段性规划和完善的测试套件指导下,AI 智能体能够胜任复杂的重构工作。 作者认为,随着 AI 编程能力的提升,软件开发的主要瓶颈已从编码速度转向了人类的协调与统筹。 此外,该版本重新定义了 BDD 在 AI 工作流中的价值。过去,由于维护成本高昂,BDD 的价值往往难以体现;而现在,AI 可以轻松生成并维护可执行的规范。这些规范充当了至关重要的“事实来源”,为智能体提供了丰富的领域上下文,确保代码始终符合既定行为。Yadda 3.1.0 进一步强化了这一点,支持使用 GitHub 风格的 Markdown 编写功能描述,实现了文档与可执行测试的无缝集成。随着软件越来越多地由机器编写,可执行规范在架起人类意图与机器实现之间的桥梁方面,正变得前所未有的重要。

这段 Hacker News 的讨论围绕 JavaScript BDD(行为驱动开发)库 **Yadda 3.0.0** 的发布展开。作者强调,此次更新主要由 AI 智能体完成,这表明在智能体开发工作流中,可执行规范正变得愈发重要。 评论区针对 BDD 的价值及自然语言抽象表现出明显的意见分歧: * **怀疑论:** 许多用户质疑使用自然语言进行测试的实用性,认为标准编程结构效率更高,且“产品”角色往往无法提供使 BDD 有效运行所需的必要输入。 * **AI 视角:** 支持者认为,BDD 在 AI 辅助开发中具有独特优势。通过将会议记录转化为 BDD 风格的规范,开发者可以建立起“单一事实来源”,从而指导 AI 智能体进行规划、测试和实现。 * **术语争议:** 关于“BDD”(行为驱动开发)这一缩写产生了一些讨论,部分参与者认为该术语已失去主流地位,而另一些人则认为它仍是工程师应掌握的基础概念。 最终,该讨论串反映出一种转变:BDD 的作用已不仅仅局限于人类协作,而是开始成为驱动 AI 软件工程的一种结构化桥梁。
相关文章

原文

I’ve just published Yadda 3.0.0 to npm.

For anyone unfamiliar with it, Yadda is a BDD library for JavaScript. Like Cucumber, it maps ordinary language specifications to executable code, but it was designed from the ground up to be much less prescriptive about how those specifications are written.

That means that instead of writing something like:

Given a university, The University of Bouvet Island
And The University of Bouvet Island offers a degree course in Computer Science with entry requirements of ABB
And an A-Level graduate, Steve
And Steve has a D in Physics
And Steve has a D in Maths
When Steve applies to study Computer Science at The University of Bouvet Island
Then The University of Bouvet Island rejects the application

you can write:

The University of Bouvet Island offers a degree course in Computer Science
The entry requirements for which are ABB
Steve is an A-Level graduate
With a D in Physics
And a D in Maths
When Steve applies to study Computer Science at The University of Bouvet Island
They reject his application

Both are executable specifications. I find the second considerably easier to read.

What’s changed in Yadda 3?

Most of Yadda 3.0 is a modernisation exercise.

Yadda has been around for a long time, and the repository had accumulated integrations and tooling for parts of the JavaScript ecosystem that are now themselves historical curiosities. Yadda 3 is Node-only, removes browser bundling and obsolete integrations such as CasperJS, PhantomJS, Bower and Component, moves the test suite to node:test, adopts Biome and lefthook, modernises the source to ES6 syntax, and adds current examples including Playwright and Puppeteer. It also now ships TypeScript definitions.

All useful, but not especially interesting to write about. There are two things about the release that I think are much more significant.

Claude wrote most of it

I modernised Yadda using Claude Code with Opus 4.8.

The Yadda 3.0 epic, which was itself written by Claude, broke the work into a series of deliberately separated phases: remove obsolete functionality, update the toolchain, perform mechanical formatting separately from behavioural changes, modernise the source, explore API changes, update examples and CI, then finish the metadata, documentation and TypeScript definitions.

We planned each phase before implementing it, and then I largely let Claude get on with the work. It made remarkably few mistakes and, more impressively, identified some fairly subtle edge cases that would have been easy to miss during what initially looked like a mechanical modernisation. I made very few interventions.

One important factor was that Yadda already had a comprehensive test suite. I also deliberately avoided asking Claude to modify production code and the corresponding tests in the same step. If an agent changes both simultaneously, a green test suite becomes weaker evidence because it is free to change the definition of “correct” at the same time as the implementation. Keeping those changes separate gave Claude a much firmer external constraint.

From starting the work to having the package published was roughly a day of elapsed time, and I was doing other things in parallel.

At the beginning of this year I wrote about an experiment asking why experiences of vibe coding were so polarised. My conclusion then was that the results depended enormously on how the agent was used. A tightly constrained and supervised Claude could produce extremely good results very quickly. Left to its own devices, it tended towards architectural drift, unnecessary code and operational debt.

That was only seven months ago, and the capability has moved on enormously. Even so, saying that Claude can now write this code with very little intervention barely scratches the surface of what is changing.

Coding is no longer the bottleneck

To appreciate where this is going, it helps to stop thinking about a single developer having a conversation with a single coding agent and instead consider several agents working in parallel.

There are already several ways to do this. You can simply run multiple Claude Code sessions. Git worktrees let each agent work against an isolated working copy. Tools such as cmux make running a collection of Claude sessions more manageable, while Claude Code Agent View provides another way of seeing what multiple sessions are doing and which ones need attention.

All of these let you build significantly faster than working serially, but I fairly quickly hit another limit: my own ability to manage the parallel work. I can comfortably keep three tasks moving at once, and sometimes four or five. Beyond that, I start losing the context of what each agent is doing, which decisions have been made, which task is waiting for me and what I need to review next.

At that point, the model is not overloaded and the machine is not overloaded. The bottleneck is the human coordinating the work. I’ve become convinced that good orchestration is the next important layer.

I’m not alone in reaching that conclusion. My colleague Marco describes almost exactly this progression in My AI Engineering Journey, moving from AI as autocomplete, through supervised and trusted agents, to parallel agents where cognitive load becomes the constraint. He is further along this journey than I am, and has responded by building Otto, an orchestration UI around Claude Code and worktrees, before moving on to agent pipelines that coordinate implementation, review, feedback and documentation.

The larger point is that AI-assisted software development is still moving extraordinarily quickly. Individual coding capability has improved dramatically, parallel execution is already practical, and the next constraint is increasingly the coordination of all that capability. The tools and approaches for doing so are developing just as quickly, and are now arguably even more important than the model updates.

Which brings me back to Yadda.

Why update a BDD library now?

I’ve always thought BDD was valuable for several reasons.

Firstly, writing requirements in ordinary language forces you to articulate the domain and, more importantly, encourages you to articulate it consistently. If you write those specifications before writing the implementation, that domain language has a habit of propagating through the codebase. The same concepts start appearing in class and function names, API definitions, database schemas, CSS classes and user interfaces. That gives the codebase a coherence that is surprisingly difficult to achieve retrospectively.

Secondly, executable specifications are far more accessible than conventional programmatic tests. A product manager, analyst or domain expert has a realistic chance of understanding:

When Steve applies to study Computer Science
Then the university rejects his application

They are much less likely to extract the same meaning from a Jest test containing fixtures, mocks, builders and assertions.

Thirdly, BDD provides a useful abstraction layer for functional tests. The specification describes intent while the step implementation deals with mechanics such as selectors, navigation and browser interaction. This provides some of the same benefits as the Page Object pattern: changes to the user interface can often be absorbed inside the abstraction instead of leaking through hundreds of tests.

There has always been a cost, though. BDD tests take longer to write initially. You need to think about the language, create reusable steps, and resist the temptation to write procedural scripts disguised as English. The payoff comes later, through better domain modelling, better communication and more maintainable functional tests. That deferred payoff has always made BDD harder to justify, but I think AI changes the economics.

Executable specifications are very good context for agents

Consider an engineering workflow that is becoming increasingly plausible.

Meetings are automatically transcribed and stored as GitHub discussions. Those discussions are analysed and used to update a project wiki. The wiki is mined for requirements and issues. Those issues are then picked up, implemented, reviewed and coordinated by a collection of coding agents.

A wiki can tell you what somebody thought the system should do. It can tell you what the system used to do. It can even tell you what an agent inferred that the system ought to do. It cannot, by itself, tell you whether the system actually does it. An executable specification can. That makes BDD much more interesting in an agentic development environment than it was before.

The expensive part of BDD was producing and maintaining the specification. AI makes much of that work cheap. A transcript, discussion or requirement can be transformed into a candidate specification almost trivially, with a human concentrating on whether the language and behaviour are correct rather than typing it all out. Once accepted, that specification becomes more than documentation. It becomes a contract.

An implementation agent can use it to understand the required behaviour. A testing agent can use it to determine what needs validating. A reviewing agent can use it to challenge an implementation. CI can continuously verify it. Because it is executable, it remains coupled to the behaviour of the software in a way that a wiki page never can.

There is an interesting inversion here. BDD was created partly to make software specifications more useful to humans, but executable specifications may turn out to be even more valuable when much of the software is being written by machines. The natural language gives agents rich domain context, while the executable steps ensure that the specification remains grounded in the behaviour of the system.

One other change (added in Yadda v3.1.0) is support for writing feature specifications as GitHub-flavoured Markdown. This makes them easier to read in the repository and, more importantly, allows them to live naturally alongside the project wiki and the other key knowledge artefacts that humans and agents use to understand the system. The same specification can now be written as:

# Feature: University applications

## Scenario: Applicant does not meet the entry requirements

- The University of Bouvet Island offers a degree course in Computer Science
- The entry requirements for which are ABB
- Steve is an A-Level graduate
- With a D in Physics
- And a D in Maths
- When Steve applies to study Computer Science at The University of Bouvet Island
- They reject his application

It remains an executable specification, but when viewed on GitHub it looks and behaves much more like the rest of the project’s documentation.

Yadda 3 is available on npm, and the source, documentation and examples are on GitHub.

联系我们 contact @ memedata.com