问题描述
在过去的几年中,测试驱动开发一直是.NET社区中的热门话题.最近,我在ALT.NET社区中听到有关BDD的抱怨.它是什么?与TDD有何不同?
Test Driven Development has been the rage in the .NET community for the last few years. Recently, I have heard grumblings in the ALT.NET community about BDD. What is it? What makes it different from TDD?
推荐答案
我了解BDD与测试相比,更了解规格.它与域驱动设计链接(您不喜欢这些* DD首字母缩写词吗?).
I understand BDD to be more about specification than testing. It is linked to Domain Driven Design (don't you love these *DD acronyms?).
它与编写用户案例的特定方式(包括高级测试)相关联. 汤姆十的例子Thij :
It is linked with a certain way to write user stories, including high-level tests. An example by Tom ten Thij:
Story: User logging in
As a user
I want to login with my details
So that I can get access to the site
Scenario: User uses wrong password
Given a username 'jdoe'
And a password 'letmein'
When the user logs in with username and password
Then the login form should be shown again
(在他的文章中,汤姆继续在Ruby中直接执行此测试规范.)
(In his article, Tom goes on to directly execute this test specification in Ruby.)
BDD的教皇是丹北.您会在他的介绍BDD 文章中找到很好的介绍.
The pope of BDD is Dan North. You'll find a great introduction in his Introducing BDD article.
您可以在此视频中找到BDD和TDD的比较.也被杰里米·米勒(Jeremy D. Miller)
You will find a comparison of BDD and TDD in this video. Also an opinion about BDD as "TDD done right" by Jeremy D. Miller
2013年3月25日更新
上面的视频丢失了一阵子了.这是Llewellyn Falco的最新作品, BDD vs TDD(解释).我认为他的解释很明确,很明确.
The video above has been missing for a while. Here is a recent one by Llewellyn Falco, BDD vs TDD (explained). I find his explanation clear and to the point.
这篇关于TDD和BDD之间的主要区别是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!