Blog on Dan North & Associates Limited 09月30日 19:09
BDD与TDD的比较分析
index_new5.html
../../../zaker_core/zaker_tpl_static/wap/tpl_guoji1.html

 

许多人认为BDD(行为驱动开发)本质上就是TDD(测试驱动开发),例如Robert Martin和Ron Jeffries的观点。作者指出,在程序员主导的小团队中,BDD与TDD确实相似,但BDD更适合更广泛的受众,如测试员、分析师等,因为它强调跨所有利益相关者的沟通,以创建单一的一致愿景。BDD解决了TDD无法处理更复杂的沟通问题,是XP的一部分,但比TDD更广泛。

🔍 BDD与TDD在程序员主导的小团队中确实相似,因为所有利益相关者都是程序员,且只有一个主题专家(SME)。

🌐 BDD更适合更广泛的受众,包括测试员、分析师、项目经理等,强调跨所有利益相关者的沟通,以创建单一的一致愿景。

🗣️ BDD解决了TDD无法处理更复杂的沟通问题,是XP的一部分,但比TDD更广泛,旨在帮助业务和技术人员达成共识。

💡 作者指出,在程序员主导的小团队中,BDD与TDD的作用相似,但在更复杂的组织中,BDD的价值体现在其沟通和协作能力上。

📚 BDD通过“活文档”的形式实现沟通,这是TDD无法做到的,只有在需要时才显得必要,因为程序员团队仅依赖TDD也能良好运作。

I’ve noticed a number of people recently declaring that BDD really is just TDD, such as Robert Martin on Twitter and Ron Jeffries on the XP list. I can understand where this mindset comes from and I’d like to offer my perspective.

Is BDD the same as TDD? Yes. If you’re a programmer, and your entire team is programmers, and all your stakeholders are programmers and you have a single Subject Matter Expert embedded in the team. Which was true of the Chrysler C3 team and other early XP teams. (Take a look at the original C3 team at Chrysler: 10 world-class programmers and an SME.)

BDD is the same thing but for a broader audience: testers, analysts, project and program managers, multiple SMEs covering multiple interrelated domains. It’s interesting that the BDD == TDD crowd are entirely programmers and necessarily see the world through programmers’ eyes: Bob Martin, Ron Jeffries and others saying “BDD is just TDD” is true in the first approximation of “all delivery people are programmers.” As soon as that precondition fails, BDD becomes a different, bigger thing: it becomes the communication across all of those stakeholders to create a single coherent vision and deliver to that. This is the value of living documentation—and shows why you don’t need it until you do: if you’re in that small team of only-programmers you’ll be fine with only-TDD.

It can be argued that the team shouldn’t be anything other than programmers—in the polyglot roles of tester, analyst, etc.—in which case BDD and TDD again collapse into the same space. But in the kind of organizations and teams that gave rise to and shaped BDD we have to solve the more complex communication problems that are (by definition) beyond the scope of TDD.

I’ve been entirely embedded in small teams of programmers for the last couple of years which is why I’ve taken much more of a back seat in the BDD community. The likes of Liz Keogh, Gojko Adzic and Chris Matts have been where the action is with things like real options and specification-by-example, and folks like Aslak Hellesøy and Matt Wynne figuring out how to manage large numbers of long-lived tests at scale. Liz recently wrote about how shifting the language helps to clarify intent.

Kent Beck describes XP as trying to get business people and technical people on the same page, and I have the same goal for BDD. Don’t forget TDD is one small part of XP. BDD has grown to be broader than s/test/should/, because it’s trying to solve a broader problem.

Check out

Goalwards®

, our new business agility practice!

Fish AI Reader

Fish AI Reader

AI辅助创作,多种专业模板,深度分析,高质量内容生成。从观点提取到深度思考,FishAI为您提供全方位的创作支持。新版本引入自定义参数,让您的创作更加个性化和精准。

FishAI

FishAI

鱼阅,AI 时代的下一个智能信息助手,助你摆脱信息焦虑

联系邮箱 441953276@qq.com

相关标签

BDD TDD 行为驱动开发 测试驱动开发 XP 软件开发
相关文章