【翻译稿】Behavior Driven Development (BDD)行为驱动开发
这是一篇翻译稿,方便给不知道BDD的同学扫盲。原文链接:What is BDD (Behavior Driven Development)? | Agile Alliance
Definition定义
Behaviour Driven Development (BDD) is a synthesis and refinement of practices stemming from Test Driven Development (TDD) and Acceptance Test Driven Development (ATDD). BDD augments TDD and ATDD with the following tactics:
行为驱动开发 (BDD) 是对源自测试驱动开发 (TDD) 和验收测试驱动开发 (ATDD) 的实践的整合和改进。 BDD 通过以下策略增强 TDD 和 ATDD:
- Apply the “Five Why’s” principle to each proposed user story, so that its purpose is clearly related to business outcomes
- thinking “from the outside in”, in other words implement only those behaviors which contribute most directly to these business outcomes, so as to minimize waste
- describe behaviors in a single notation which is directly accessible to domain experts, testers and developers, so as to improve communication
- apply these techniques all the way down to the lowest levels of abstraction of the software, paying particular attention to the distribution of behavior, so that evolution remains cheap
- 将“五个为什么”原则应用于每个提议的用户故事,使其目的与业务成果明确相关
- “由外而内”思考,换言之,只实施对这些业务成果有最直接贡献的行为,以最大程度地减少浪费
- 用单一符号描述行为,领域专家、测试人员和开发人员可以直接访问,以改善沟通
- 将这些技术一直应用到软件的最低抽象级别,特别注意行为的分布,从而用较低的成本实现功能的演进
Also Known As别称
BDD is also referred to as Specification by Example.
BDD 也称为用例子来描述的需求规格说明书。
Expected Benefits可能带来的好处
Teams already using TDD or ATDD may want to consider BDD for several reasons:
已经使用 TDD 或 ATDD 的团队可能出于以下几个原因想要考虑 BDD:
- BDD offers more precise guidance on organizing the conversation between developers, testers and domain experts
- notations originating in the BDD approach, in particular the given-when-then canvas, are closer to everyday language and have a shallower learning curve compared to those of tools such as Fit/FitNesse
- tools targeting a BDD approach generally afford the automatic generation of technical and end user documentation from BDD “specifications”
- BDD 为组织开发人员、测试人员和领域专家之间的对话提供了更精确的指导
- 与 Fit/FitNesse 等工具相比,源自 BDD 方法的符号,尤其是场景-时间-动作画布,更接近日常语言,并且学习曲线更浅
- 针对 BDD 方法的工具通常能够根据 BDD“规范”自动生成技术和最终用户文档
Common Pitfalls弊端
Although Dan North, who first formulated the BDD approach, claims that it was designed to address recurring issues in the teaching of TDD, it is clear that BDD requires familiarity with a greater range of concepts than TDD does, and it seems difficult to recommend a novice programmer should first learn BDD without prior exposure to TDD concepts
尽管首先制定 BDD 方法的 Dan North 声称它旨在解决 TDD 教学中反复出现的问题,但很明显,BDD 需要比 TDD 熟悉更多的概念,而且也不推荐一个新手程序员在没有任何TDD概念基础的情况下接触 BDD。
The use of BDD requires no particular tools or programming languages, and is primarily a conceptual approach; to make it a purely technical practice or one that hinges on specific tooling would be to miss the point altogether
BDD 的使用不需要特定的工具或编程语言,主要是一种概念方法; 这容易使其容易成为纯粹的技术实践,如果没有好的工具,相关理念很难实施。
Origins缘起
- 2003: agiledox, the ancestor of BDD, is a tool generating technical documentation automatically from JUnit tests, written by Chris Stevenson
- 2004: Chris Matts and Dan North proposed the given-when-then canvas to expand the scope of BDD to business analysis and documents
- 2004: in order to test his hypotheses about de-emphasizing “test” terminology in favor of “behavior”, Dan North releases JBehave
- 2006: Dan North documents the approach in “Introducing BDD”
- 2006-2009: several new tools are released confirming the community’s investment in BDD, such as RSpec or more recently, Cucumber and GivWenZen
Signs of Use使用说明
- A team using BDD should be able to provide a significant portion of “functional documentation” in the form of User Stories augmented with executable scenarios or examples.
- Instead of referring to “tests”, a BDD practitioner will prefer the terms “scenario” and “specification”. As currently practiced, BDD aims to gather in a single place the specification of an outcome valuable to a user, generally using the role-feature matrix of (User Stories), as well as examples or scenarios expressed in the form given-when-then; these two notations being often considered the most readable.
- In emphasizing the term “specification”, the intent of BDD is to provide a single answer to what many Agile teams view as separate activities: the creation of unit tests and “technical” code on one hand, the creation of functional tests and “features” on the other hand. This should lead to increased collaboration between developers, test specialists, and domain experts.
- Rather than refer to “the unit tests of a class”, a practitioner or a team using BDD prefers to speak of “the specifications of the behavior of the class”. This reflects a greater focus on the documentary role of such specifications: their names are expected to be more expressive, and, when completed with their description in given-when-then format, to serve as technical documentation.
- Rather than refer to “functional tests”, the preferred term will be “specifications of the product’s behavior”. The technical aspects of BDD are placed on an equal footing with techniques encouraging more effective conversation with customers, users and domain experts.
- In addition to refactoring techniques already present in TDD, the design philosophy in BDD pays particular attention to appropriate distribution of responsibilities among classes, which leads its practitioners to emphasize “mocking”.
- 使用 BDD 的团队应该能够以用户故事的形式提供大部分“功能文档”,并增加了可执行场景或示例。
- BDD 从业者不会提及“测试”,而是更喜欢“场景”和“规范”这两个术语。按照目前的做法,BDD 的目标是在一个地方收集对用户有价值的结果的规范,通常使用(用户故事)的角色特征矩阵,以及以“场景-时间-行为”形式表达的示例或场景;这两种符号通常被认为是最易读的。
- 在强调术语“规范”时,BDD 的目的是为许多敏捷团队视为独立活动的内容提供单一答案:一方面创建单元测试和“技术”代码,一方面创建功能测试和“特性”。 “ 另一方面。这应该会导致开发人员、测试专家和领域专家之间加强协作。
- 与“类的单元测试”不同,使用 BDD 的从业者或团队更喜欢谈论“类的行为规范”。这反映了对此类规范的文档作用的更大关注:它们的名称应该更具表现力,并且在以“何时给定”格式完成描述后,可用作技术文档。
- 首选术语不是“功能测试”,而是“产品行为规范”。BDD 的技术方面与鼓励与客户、用户和领域专家进行更有效对话的技术处于同等地位。
- 除了 TDD 中已经存在的重构技术,BDD 中的设计理念特别关注类之间的适当职责分配,这导致其从业者强调“mocking”。
Further Reading参考文献
“Introducing BDD”, by Dan North (2006)
“Translating TDD to BDD”, by Liz Keogh (2009)
A tool stack for implementing Behaviour-Driven Development in Python Language by Tavares, Rezende, dos Santos, Manhaes, de Carvalho (2010)
【翻译稿】Behavior Driven Development (BDD)行为驱动开发的更多相关文章
- [翻译]Behavior-Driven Development (BDD)行为驱动开发(二)
测试驱动开发体现了开发人员对软件产品各部分运作方式的理解,而行为驱动开发则关注于开发人员对软件产品最终表现的行为的预期. 行为驱动开发 TDD更像是一种范式而不是一个过程.它描述了一种先编写测试,然后 ...
- [翻译]Behavior-Driven Development (BDD)行为驱动开发(一)
简单而言,BDD是一系列基于TDD的工具和方法集发展而来的开发模式,一般不认为是一种新的开发模式,而是作为TDD的补充.因此,首先对TDD的概念进行进行. 测试驱动开发(TDD) TDD模式采取的是迭 ...
- 行为驱动开发iOS <收藏>
前段时间在design+code购买了一个学习iOS设计和编码在线课程,使用Sketch设计App,然后使用Swift语言实现Designer News客户端.作者Meng To已经开源到Github ...
- .NET里的行为驱动开发
BDD (Given - When - then) Ruby Cucumber, Java FitNesse , Python RoboFramework, C# specflow nspec .NE ...
- 行为驱动开发BDD和Cucunber简介
测试驱动开发(TDD) 1.测试驱动开发,即Test-Driven Development(TDD),测试驱动开发是敏捷开发中的一项核心实践和技术,也是一种设计方法论.TDD的原理是在开发功能代码之前 ...
- 行为驱动开发BDD概要
BDD脱胎于TDD 行为驱动开发(Behavior-Driven Development,简称BDD),是在测试驱动开发(Test-Driven Development,TDD)基础上发展而来的一种软 ...
- ASIHTTPRequest使用指南---<<翻译稿>>
ASIHTTPRequest使用指南---<<翻译稿>> 当第一次使用ASIHTTPRequest进行http请求时,会出现非常多的bug提示.查了一些资料,发现在少倒入了几个 ...
- Bug驱动开发(Bug-driven development)
说实话,作为一个Domino开发者,像測试驱动开发(Test-driven development).功能驱动开发(Feature-driven development)之类软件开发的高大上的方法论( ...
- 行为驱动开发(BDD)
行为驱动开发(BDD) 引言 BDD是对TDD理念的扩展.BDD强调有利害关系的技术团体和非技术团队都要参与到软件开发过程中.可以把它看成一种强调团体间合作的敏捷方法.大多数采用某种敏捷方法的团队最终 ...
随机推荐
- 详解Spring中Bean的作用域与生命周期
摘要:在利用Spring进行IOC配置时,关于bean的配置和使用一直都是比较重要的一部分,同时如何合理的使用和创建bean对象,也是小伙伴们在学习和使用Spring时需要注意的部分,所以这一篇文章我 ...
- DEV-C++ 5.11调试设置方法
DEV-C++调试设置方法:默认不能调试,打开调试的方法: 1.点击"工具"菜单--编译选项--"代码生成/优化"--连接器--"产生调试信息&quo ...
- VS Code 下载安装并设置中文面板显示
下载: 下载地址:https://code.visualstudio.com/ 微软在2015年4月30日Build 开发者大会上正式宣布了 Visual Studio Code 项目:一个运行于 M ...
- Java的标准日志
虽然开源社区有很多优秀的日志框架,但我们学习标准的java日志框架是为了更好的理解其他框架啊(近期项目要用ELK) 看自己以前写的Log4J简直不忍直视啊啊啊啊,那时还感觉自我良好 1. 为什么要使用 ...
- Leetcode春季打卡第四天:994. 腐烂的橘子
Leetcode春季打卡第四天:994. 腐烂的橘子 Leetcode春季打卡第四天:994. 腐烂的橘子 思路 思路是采用广度优先搜索,一层一层遍历. 首先先扫描矩阵,将坏橘子放进队列,记录正常橘子 ...
- Docker与k8s的恩怨情仇(六)—— “容器编排”上演“终结者”大片
转载请注明出处:葡萄城官网,葡萄城为开发者提供专业的开发工具.解决方案和服务,赋能开发者. 在上节中,我们为大家介绍了Pod的基础内容,Kubernetes如何站在上帝视角上处理容器和容器之间的关系. ...
- 搭建SAMBA服务
说明:这里是Linux服务综合搭建文章的一部分,本文可以作为单独搭建SABMA服务的参考. 注意:这里所有的标题都是根据主要的文章(Linux基础服务搭建综合)的顺序来做的. 如果需要查看相关软件版本 ...
- navigator导航页面跳转与绑定事件
效果图: 1. 新建一个index页面 主页面分为两块,上面是导航条,下面是轮播图. 导航条: <view class='menu'> <scroll-view scroll-x&g ...
- Java 中 this 和 super 的用法详解
前言 这次我们来回顾一下this和super这两个关键字的用法,作为一名Java程序员,我觉得基础是最重要的,因为它决定了我们的上限,所以我的文章大部分还是以分享Java基础知识为主,学好基础,后面的 ...
- Treestar Flowjo 10.6.2 for win64安装破解教程
Treestar FlowJo v10.6.2是一款极其优秀好用的流式细胞数据分析工具,通过图像分析细胞的各种变化,利用软件自带的分析功能,结合细胞模型创建合理的数据分析平台.本教程提供其安装包.注册 ...