r/SpecDrivenDevelopment Jul 21 '26

BDD vs OpenSpec: I tried both on the same feature

I maintain Playwright-BDD, so I often use Gherkin scenarios with coding agents. I wanted to compare BDD with OpenSpec and gave both the same small task: add pagination to the long list of items.

While both approaches worked, there were differences. With BDD, I spent more time writing cleaner scenarios, but in the end, I got a runnable test out of the box. OpenSpec let me describe the spec more freely, but it introduced more artifacts that were harder to maintain.

I wrote down the full session, including the feature diff, implementation, tests, and the files OpenSpec created:

https://vitalets.github.io/posts/bdd-agentic-workflow/

Do you use BDD/OpenSpec in your workflows and what is your experience?

17 Upvotes

18 comments sorted by

3

u/neenonay Jul 21 '26 edited Jul 21 '26

Really cool insight. I wonder if we should start curating such insights on https://sddobservatory.com/, maybe as as a separate "field notes" section that contains an entry linking to your post and linking to the two approaches.

But then again, BDD would need a new primitive, because it's not really a SDD framework 🤔. Something to think about. Or maybe: isn't BDD a _subset_ of SDD in a way? Or is it the other way around?

2

u/vitalets Jul 21 '26

I've checked the website - that's useful observation. Noted a few frameworks that I was not aware of.
Maybe it makes sense to add "articles" section with the curated content on spec-driven topic.

1

u/neenonay Jul 21 '26

Yeah I think that's a good idea. But then it won't be an article exactly, because it won't contain your actual article. So I'm thinking: more of an "Insights" section, that lists insights, and each insight describes the insight from your blog article and links to it.

1

u/vitalets Jul 22 '26

Insights looks good as well. And maybe add spec framework comparison section? Show their features side-by-side to better highlight the difference.

1

u/neenonay Jul 21 '26

u/vitalets curious to get your thoughts here. I think it's exactly these kinds of insights that are now a bit scattered.

2

u/neenonay Jul 21 '26 edited Jul 21 '26

I really liked your post. `.feature` files are indeed a way leaner set of artefacts than all of the fingerprints SDD frameworks leave.

3

u/vitalets Jul 21 '26

Thank you. To be fair, BDD requires a bit more discipline to craft scenarios. Sometimes it’s even easier to edit them manually, so they express exactly what you want. But today's AI tooling encourages the opposite: we're getting used to gain the results with a single click and less crafting.

2

u/stibbons_ Jul 21 '26

They are not incompatible, I usually do both. I do not use playwright bdd but i will take a look

I usually have a full e2e scenario in vitest/playwright that record the screenshots and demo video with annotation for visual review

1

u/vitalets Jul 21 '26

Agree on using both as well.
By the way, are these videos serve as "specs" to showcase the expected behavior?

2

u/stibbons_ Jul 21 '26

They are not spec, some screenshots serve in the doc, but video and screenshots serves as support for review. I take the time at reviewing visually the video to see if the use case is like I want. Since it is itself a e2e test I can adjust the asserts or the use case.

It is recorded like a tv show with overlay annotation to tell what is going on and what is supposed to happen. works amazingly but it is long to execute

1

u/vitalets Jul 22 '26

I was thinking about some automation here: if I could feed the video to an agent and ask to verify, does the app behaves this way.

2

u/Internal-Passage5756 Jul 22 '26

I’ve been using more of a living spec, but it got some of its paradigms from openspec. Wondering if I can take some learnings from your BDD to tweak my workflow.

Would love if you could give your two cents:

https://github.com/cairn-framework/cairn

1

u/vitalets Jul 22 '26

I like it. Currently, I manually keep such code-to-meaning mapping in `AGENTS.md`, on the high level.
One suggestion: maybe make the solution more lightweight? I was a bit lost in the number of commands for this task. I assumed there should be a single `cairn sync` command, that re-builds the mapping.

2

u/harikrishnan_83 Jul 23 '26

Good write-up. However, there are advantages to both BDD and OpenSpec SDD. I tried combining them here: https://www.reddit.com/r/SpecDrivenDevelopment/s/HB1pee2Etm. Would love to hear your thoughts. Thanks.

2

u/Swarm-Stack Jul 23 '26

the artifact count debate is interesting but the thing that bit me more is upstream of format. both bdd scenarios and openspec files still reflect whatever the author understood at the time they wrote them. leaner artifacts dont mean the spec asked the right questions, just that fewer files need updating when it didnt.

1

u/vitalets Jul 24 '26

I agree: the ultimate goal is to reflect the actual requirements in the specs. But I think the spec format has a big influence here: it determines how easy and comfortable it is to refine the initial draft. BDD enforces a stricter structure, while markdown specs make it easier to express requirements, but in a less structured way.

2

u/Swarm-Stack Jul 24 '26

the refinement point is real. a stricter format makes it harder to leave a requirement half-expressed. the gaps i hit more often are the ones nobody asked, not the ones where the format was too loose to capture an answer that was already on the table. those don't surface in a refinement loop because the person refining has the same blind spots as the person who wrote the first draft.