TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: BDD and Gherkin tests, do they provide value in the real world?

2 点作者 floppydisc将近 2 年前
Recently stumbled upon BDD and the process of describing software from behaviour. I know there are seriously prolific software engineers amongst the Hacker News crowd and I could use a second opinion from within the industry.<p>What are your thoughts on BDD in general, with everything included (Gherkin, Cucumber etc.). What benefits have you yourself experienced (if any) or perhaps disadvantages of such ideas?

2 条评论

hitchstory将近 2 年前
I like the overall idea a <i>lot</i> but I felt that the Gherkin language itself hamstrings the process - for four main reasons:<p>* Excessive verbosity<p>* Not type safe<p>* It lacks story abstractions (i.e. you can&#x27;t flexibly create variations on a scenario, extend existing scenarios, etc.).<p>* You need to fiddle with regexes.<p>A side effect of these semantic&#x2F;syntactic problems is that gherkin stories end up being too vague to be useful - i.e. the meat of the story is often missing.<p>I created a StrictYAML based alternative with python that I think has all of the benefits, fixes those 4 problems and doesnt suffer from traditional &quot;YAML&quot; problems: <a href="https:&#x2F;&#x2F;github.com&#x2F;hitchdev&#x2F;hitchstory">https:&#x2F;&#x2F;github.com&#x2F;hitchdev&#x2F;hitchstory</a><p>I call this &quot;BDD with meat&quot;.
评论 #36258280 未加载
breckenedge将近 2 年前
I last gave it a good try about 12 years ago. In principle I liked it, but in practice it’s fairly verbose and slow. I much prefer Cypress&#x2F;Capybara style testing.
评论 #36258306 未加载