认识BDD行为驱动开发_认识Cucumber_2015年3月剖析.ppt

认识BDD行为驱动开发_认识Cucumber_2015年3月剖析.ppt

  1. 1、本文档共17页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
认识BDD行为驱动开发_认识Cucumber_2015年3月剖析

Agile specifications, BDD and Testing eXchange TDD 当前面向单元测试 xUnit 组织测试代码,执行测试代码,提供辅助工具(断言) Mock对象模拟对象可以模拟复杂的、真实的(非模拟)对象的行为, 如果真实的对象无法放入单元测试中,使用模拟对象就很有帮助。框架用来快速的建立模拟对象。 Introducing BDD 1、用于执行专用行为语言的 Gherkin提供一个可读性很强的DSL Feature文件 支持多种语言 一个文件有多个场景 实例化需求 认识BDD行为驱动开发 认识Cucumber 2015年3月 成都 什么是BDD Behaviour-Driven Development is a second-generation, outside-in, pull-based, multiple-stakeholder, multiple-scale, high-automation, agile methodology. It describes a cycle of interactions with well-defined outputs, resulting in the delivery of working, tested software that matters. --November 2009 in London, Dan North 我说: BDD是TDD的一个变种,在TDD的基本概念上产生的衍生产物。将编写测试代码的步骤,替换为描述系统行为。 什么是TDD Test-driven development 测试驱动开发 用xUnit写单元测试代码? 先测试再开发? 测试驱动开发周期 目的:开发的软件是正确的 什么是TDD 敏捷开发原则 通过持续不断地及早交付有价值的软件 欣然面对需求变化 重构 红—绿—重构 结构上的可测试性 狭义的TDD 面向单元测试的测试驱动开发 xUnit工具, JUnit、TestNG NUnit,CPPUnit,PHPUnit,Text::Unit DBUnit,HTMLUnit,MRUnit Mock工具 EasyMock,Google Mock 代码覆盖率工具 EMMA、NCover、SimpleCov 衍生出BDD Dan North 遇到的问题: Programmers wanted to know where to start, what to test and what not to test, how much to test in one go, what to call their tests, and how to understand why a test fails. 测试代码 更可读的测试代码 描述行为的通用语言 改变的是思考方式!! 描述行为的通用语言 User Story用户故事 As a 角色 I want 目标/希望 so that 收益 Given-When-Then Given 已登录报工系统 And 本周报工页面 When 录入每日工作时间 And 点击“保存”按钮 Then 完成报工,记录报工数据。 As a 员工 I want 填写每日工作时间 So that 完成报工 自动执行 说说ATDD Acceptance Test-Driven Development验收测试驱动开发 Acceptance Test Driven Development (ATDD) is a practice in which the whole team collaboratively discusses acceptance criteria, with examples, and then distills them into a set of concrete acceptance tests before development begins. It’s the best way I know to ensure that we all have the same shared understanding of what it is we’re actually building. It’s also the best way I know to ensure we have a shared definition of Done. 交流协作 编码前先设计验收标准 没有强调工作周期? 自动化? Cucumber BDD世界中的xUnit Jbehave - Rbehave - Rspec -Cucumber / Ruby编写的 命令行工具 第一个例子,

文档评论(0)

ee88870 + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档