版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、Outline1Features and RequirementsSpecification by ExampleBehavior Driven DevelopmentCucumberSummary2What, exactly is this system supposed to do?Feature vs RequirementsWhat is a requirement? A requirement is a capability that a product must possess or something a product must do in order to ultimatel
2、y satisfy a customer need. What is a feature?A feature is a set of related requirements that allows the user to satisfy a business objective or need. 3/classes/comp415/s12/SitePages/features%20vs%20requirements.aspxExampleFeature1 Click Ordering RequirementsUser shall be able to activate 1-click ord
3、ering within his account.User shall be able to deactivate 1-click ordering within his account.User shall be able to order books with just 1-click.Test First Development 4To Write test before code RequirementsWe need requirements that are easy to write tests for.TestableRequirementsSpecification by E
4、xample Gojko Adzic, to have a broader contextual understanding of a Feature. Specification by Example is the process by which teams build software through the effective use of Examples. Defining requirements through examples allows the entire team to provide input to the contextual definition of the
5、 feature. Each row in an Example table is considered an individual test, how it gets developed (i.e. unit, integration, automation or manual) is up for the team to determine. 5Behavior = Examples = Context = Acceptance CriteriaExamples = Acceptance CriteriaBehavior driven development provides the fo
6、llowing process for defining a testable feature:Similar to Use case development 6GivenAnd WhenThenAndAn Example7Feature / User StoryIdentify the test scenariosIdentify the variablesAs a customer, I want to withdraw cash from an ATM, so that I dont have to wait in line at the bank. Scenario 1 Account
7、 is in CreditScenario 2 Account is OverdrawnWhat are considered customers (personal, business, corporate)?What are considered accounts (savings, checking, credit)?An Example8Given / When / Then Building the Behavior of Your Test First Given- Some initial context- Example: User type- Set up any preco
8、nditions When- an event occurs- Submit a page, click a link, select an optionThen- The expected responseAnd- Use with Given, When and Then when multiple steps need to be executed. An ExampleScenario 1. Account is in CreditGiven Im a customer with a valid accountAnd My Account is in CreditScenario 2.
9、 Account is OverdrawnGiven Im a customer with a valid accountAnd My Account is Overdrawn9When When I withdraw money from my account.When When I withdraw money from my account.ThenThen my account should be debited. AndRequested amount should be dispensed. ThenI should receive an error message. AndReq
10、uested amount should not be dispensed. Appropriate Usage Dont try to include everything in a single GIVEN statement. User parameters to identify different paths the test can take. Keep the WHEN statement to one specific actionEnsure that the WHEN statement is not a preconditionExample: WHEN there is
11、 cash in the ATM dispenser AND I withdraw cash from my account“cash in dispenser” is not an action and should be a pre-condition in the Given statementKeep the THEN statement to the expected result/outcome of the action identified in the WHEN statement10Using Parameters and Example Patterns for Perm
12、utations11Given Im a And I have a valid account type And My account is in CreditWhen I withdraw money from my accountThen my account should be debited And The requested amount should be dispensedUser_typeYes/noAccount_typeConsumerYesCheckingConsumerYesSavingsSmall BusinessYesCheckingSmall BusinessYe
13、s SavingsConsumerNo New account pageExample TableParametersA Brief Summary12RequirementsBehaviorFeaturesScenariosSpecTool Support: Cucumberhttp:/CDan North, and the Agile communityInitiated in April 2008, and long stories before and afterA software requirements and testing tool that enables a style
14、of development that builds on the principles of test-driven developmentWritten in Ruby, works with Ruby, Java, .NET, Flex or web applications13A Quick Tutorial141. Describe behavior in plain text. 2. Write a step definition in Ruby. 3. Run and watch it fails. 4. Write code to make the step pass. 5.
15、Run again and see the step pass. 6. Repeat 2-5 until green like a cuke. 1. Feature Scenario15Feature: Addition In order to avoid silly mistakes As a math idiot I want to be told the sum of two numbers Scenario: Add two numbers Given I have entered 50 into the calculator And I have entered 70 into th
16、e calculator When I press add Then the result should be 120 on the screen 2/3 Test16Given /I have entered 50 into the calculator/ do calculator = Calculator.newcalculator.push (n.to_i)End 4/5 Coding17class Calculator def push (n). endEnd 6. cucumber!18How Cucumber Works 19FeatureScenarioStepStepDefi
17、nitionFrameworkSystemRequirements(text files)Implementation(code)Non-technical customersMagicmappingGherkin Gherkin is the language used to write features, scenarios, and stepsThe purpose of the language is to help us write concrete requirementsConsiderCustomers should be prevented from entering inv
18、alid credit card detailsVersus If a customer enters a credit card number that isnt exactly 16 digits long, when they try to submit the form, it should be redisplayed with an error message advising them of the correct number of digits. The latter is much more testable; we want to remove as much ambig
19、uity as possible in our requirements since ambiguity is a proven source of errorsGherkin is designed to create more concreate requirements20ExampleFeature: feedback when entering invalid credit card detailsIn user testing, weve seen a lot of people who make mistakesBackground (pre-condition, true fo
20、r all scenarios below)Given I have chosen an item to buyAnd I am about to enter my credit card numberScenario: Credit card number too shortWhen I enter a card number that is less than 16 digit longAnd all the other details are correctAnd I submit the formThen the form should be displayedAnd I should see a messa
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025年旅游策划公司营销活动计划书可行性分析报告
- 2026年计算机网络安全考试试题及答案细解
- 河南省洛阳市宜阳县2027届数学七上期末经典模拟试题含解析
- 便秘的耳穴贴压技术
- 食品饮料行业26年中秋国庆白酒渠道跟踪专题报告:双节动销仍承压行业健康度边际改善
- 2026年陕西省交通安全知识测试卷及答案
- 药品注册与审批法规习题集及答案
- 湘教版高二生物胰岛素与口服降糖药同步练习题及答案
- 2026秋小学人教版数学六年级上册《分数应用题》(工程问题)易错题专项练习附参考答案
- 2026做美妆带货小程序选哪家?会员、直播、分销功能全面对比
- T/CMSGS 001-2025低空无人驾驶航空器起降点气象观测设施建设和维护要求
- 2026年书记员招聘考试公共基础知识专项试题附答案
- 道路维修验收标准方案
- 植物源性产品物种鉴别方法 Sanger测序法(征求意见稿)
- 2026年小学英语学科专业知识(含新课标核心素养)测试卷含答案(三套)
- 感染性伤口的处理原则
- 供应室岗前培训
- 行政应诉实务培训课件
- 嗜酸性肉芽肿性多血管炎诊治多学科专家共识(2025年版)解读
- 2025压力容器设计质量控制程序文件
- 【教师版】表格式审题立意小纸条
评论
0/150
提交评论