We think you have liked this presentation. If you wish to download it, please recommend it to your friends in any social system. Share buttons are a little bit lower. Thank you!
Presentation is loading. Please wait.
Published byMegan Owens
Modified over 3 years ago
Infosys Confidential © 2012 © Infosys Limited. Strictly private and confidential. No part of this document should be reproduced or distributed without the prior permission of Infosys Technologies Limited. Agile BDD using RSpec and Cucumber Aruna Banavar Shankar & Miti Bhat
Infosys Confidential © 2012 Contents BDD Installation Demo for Rspec Demo for Cucumber The Basic Features Cucumber vs. Rspec 2
Infosys Confidential © 2012 A story An elephant as seen by 6 blind people! The elephant was assumed to be what was felt by these blind people One question! – Can everyone see one entity as it is??? 3
Infosys Confidential © 2012 Introduction to BDD Getting the Words Right is the focus of BDD, leading to building one language that is understood the same way by the project stakeholders Vision is to bring in consistency, accuracy and meaning Behavior Driven Development (BDD) claims the words you use about something influence the way you think about that. 4
Infosys Confidential © 2012 How it works? As I need a towards Examples As an I need to As the I need to 5
Infosys Confidential © 2012 Key stakeholders in a project Different stakeholders, unlike mindset, varied mission come together in the project. Building an application by understanding its behavior from all stakeholder point of view. This builds a collaboration between developer, Tester, business and other teams. Developer – -Interested in coding than testing -If tester finds a defect or if time permits …… focus on defects -Let me code first is the general tendency Tester – -Primary responsibility is to test and find defects Customer – -Clarifications, approvals, sign off 6
Infosys Confidential © 2012 Then……what is BDD In the "Agile specifications, BDD and Testing eXchange" in November 2009 in London, Dan North gave the following description of BDD: BDD 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. 7
Infosys Confidential © 2012 About them… RSpec created by Steven Baker in To explore new TDD frameworks Encourage focus on behavior…. Rspec 2008, Aslak Hellesøy To explore new BDD frameworks Rewrites RSpecs Story Runner with a real grammar… Cucumber 8
Infosys Confidential © 2012 Installation Installed as gems: rspec cucumber 9
Infosys Confidential © 2012 Folder Structure 10
Infosys Confidential © 2012 Cucumber & RSpec Ref: The Rspec Book by David Chelimsky and others published by The Pragmatic Bookshelf 11
Infosys Confidential © 2012 Demo Hello Rspec 12
Infosys Confidential © 2012 Demo: Hello Cucumber 13
Infosys Confidential © 2012 Step Definitions Creates a step. Methods: Given( ) When( ) Then( ) Each must have Regexp A block. 14
Infosys Confidential © 2012 Step definitions Sample Given /^a greeter$/ = CucumberGreeter.new end When /^I send it the greet message$/ end Then /^I should see "([^"]*)"$/ do == greeting end 15
Infosys Confidential © 2012 Demo: step Definitions website2 16
Infosys Confidential © 2012 User stories Consider: User navigates to home page User enters details User successfully logs in User unsuccessful in logging in 17
Infosys Confidential © 2012 DEMO: Multiple scenarios Website: adding more scenarios without tables 18
Infosys Confidential © 2012 Scenario outlines Let us define a single scenario outline Tables of input data Expected output. 19
Infosys Confidential © 2012 Sample: Scenario outlines Scenario Outline: submit guess Given the secret code is " " When I guess " " Then the symbol should be " " 20
Infosys Confidential © 2012 Sample: scenario Outlines Scenario Outline: submit details Given the user name is " " When I guess " " Then the message should be " " Scenarios: no matches | uname | pwd | symbol| | ^^^^ | a1a1 | failed | Scenarios: 1 uname incorrect | uname | pwd | mesg | | abcd | 1555 | passed | | ba-mn| 2555 | failed | 21
Infosys Confidential © 2012 Test doubles An object that behaves as though it is the original object Eg: output 22
Infosys Confidential © 2012 Demo: Test Double Uses test double but shows logical error 23
Infosys Confidential © 2012 It method The it( ) method: creates an example ExampleGroup returns an instance of it using describe( ) Demo: website5 Note: Rspec double(out) – a mock for STDOUT 24
Infosys Confidential © 2012 A small change def 'Welcome to website!' end The test passes!!! Once the passing code is ready… See it in action!!! Demo: website6 using.bat file 25
Infosys Confidential © 2012 When Cucumber & WHEN Rspec Cucumber - integration/acceptance testing rspec/test unit - Model unit tests. 1)Define feature scenario in cucumber 2)Start by implementing every step of feature scenario 3)For each functionality required BDD that with rspec 4)Repeat until functionality is complete 26
Infosys Confidential © 2012 Hooks Hooks: Before - every scenario After - every scenario AfterStep - after every step 27
Infosys Confidential © 2012 Backgrounds Steps that are invoked Before and After every scenario Feature: browse books Background: Logged in Given I have logged in as Aruna" And the following models exist: | manufacturer | carmodel? | | Ford | yes | | Honda| no | Scenario: Display a car that already exists Scenario: Display a car that is not yet in market 28
Infosys Confidential © 2012 Configuration Command Line configuration for: Switches Options Eg: mycmd: features Usage: cucumber –p mycmd 29
Infosys Confidential © 2012 References / Bibliography The Rspec Book by David Chelimsky and others published by The Pragmatic Bookshelf Wikipedia 30
Infosys Confidential © 2012
1 Chapter 1 The Study of Body Function Image PowerPoint Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Januar 2005 S M T O T F L
25 seconds left….. 24 seconds left….. 23 seconds left…..
McDonald’s calendar 2009 January
© 2012 National Heart Foundation of Australia. Slide 2.
1 Chapter 10 Software Testing This chapter is extracted from Sommerville’s slides. Text book chapter 23 1.
GEtServices Purchasing Units & Materials Training For Suppliers Direct Order.
FIRST COURSE Microsoft Access. XP 2 Organizing Data Your first step in organizing data is to identify the individual fields – The specific value, or content,
1. XP 2 * The Web is a collection of files that reside on computers, called Web servers. * Web servers are connected to each other through the Internet.
We will resume in: 25 Minutes We will resume in: 24 Minutes.
XP New Perspectives on Browser and Basics Tutorial 1 1 Browser and Basics Tutorial 1.
Excel Functions. Part 1. Introduction 2 An Excel function is a formula or a procedure that is performed in the Visual Basic environment, outside the.
What’s new in WebSpace Changes and improvements with Xythos 7.2 Effective June 24,
1 PART 1 ILLUSTRATION OF DOCUMENTS Brief introduction to the documents contained in the envelope Detailed clarification of the documents content.
Copyright © 2008 Cengage Learning Understanding Generalist Practice, 5e, Kirst-Ashman/Hull 1.
PSSA Preparation. Question 1(no calculator) D Question 2 (no calculator)
ECATS The Honeywell Web-based Corrective Action Solution eCATS for Suppliers Last Revised: August 26, 2008 Honeywell Confidential & Proprietary.
Jeopardy Topic 1Topic Q 1Q 6Q 11Q 16Q 21 Q 2Q 7Q 12Q 17Q 22 Q 3Q 8Q 13Q 18Q 23 Q 4Q 9Q 14Q 19Q 24 Q 5Q 10Q 15Q 20Q 25 Final Jeopardy.
1 Week 2 The Object-Oriented Approach to Requirements.
CHAPTER 11 FILE INPUT & OUTPUT Introduction to Computer Science Using Ruby (c) 2012 Ophir Frieder et al.
1 Office of New Teacher Induction Introducing NTIMS New Teacher Induction Mentoring System A Tool for Documenting School Based Mentoring Mentors’ Guide.
FACTORING Think unfoil Work down, Show all steps ax 2 + bx + c.
Here it is ladies and gentlemen !!!!! The Pirelli calendar for 2009 You are the first person to receive this new Pirelli- calendar for 2009 This is the.
ABC Technology Project Mrs. Kiddle. ABCs of Technology Word 1 Word 2 Word 3 Word 4 Word 5 Word 6 Word 7 Word 8 Word 9 Word 19 Word 20 Word 21 Word 22.
©Brooks/Cole, 2001 Chapter 12 Derived Types-- Enumerated, Structure and Union.
Services Course Windows Live SkyDrive Participant Guide.
Determine Eligibility Chapter 4. Determine Eligibility 4-2 Objectives Search for Customer on database Enter application signed date and eligibility determination.
GEtServices Services Training For Suppliers Direct Orders.
© 2010 Cisco and/or its affiliates. All rights reserved.Presentation_IDCisco Confidential CISCO LEARNING CREDITS MANAGEMENT TOOL CLP ADMINISTRATOR – USER.
Year 6 mental test 5 second questions Multiplication and Division Tables knowledge.
EU Market Situation for Eggs and Poultry Management Committee 21 June 2012.
State of New Jersey Department of Health and Senior Services Patient Safety Reporting System Module 3 – Root Cause Analysis.
15. Oktober Oktober Oktober 2012.
1 Undirected Breadth First Search F A BCG DE H 2 F A BCG DE H Queue: A get Undiscovered Fringe Finished Active 0 distance from A visit(A)
McDonalds Kalender Januar
Title Subtitle 1. A. B. C. C. * D. Click to try again! INCORRECT.
1 Prof. Valter Bezerra Dantas
1 How to Enter Time. 2 Select: Log In Once logged in, Select: Employees.
©Ian Sommerville 2000Software Engineering, 6th edition. Chapter 29Slide 1 Configuration management l Managing the products of system change l Objectives.
Factor P (8-5ab) 2. 4(d² + 4) 3. 3rs(2r – s) 4. 15cd(1 + 2cd) 5. 8(4a² + 3b²) 6. 12xy(3y – 4x) 7. 5x²y(6x + 7y) 8. 3cd²(3c² - 2d) 9. 15bc³(5b +
1 Breadth First Search s s Undiscovered Discovered Finished Queue: s Top of queue 2 1 Shortest path from s.
Immunobiology: The Immune System in Health & Disease Sixth Edition Chapter 14 Manipulation of the Immune Response Copyright © 2005 by Garland Science Publishing.
Windfall Web Throughout this slide show there will be hyperlinks (highlighted in blue). Follow the hyperlinks to navigate to the specified Topic or Figure.
Page 1 of 30 To the Create Assignment Request Online Training Course An assignment request is created by an assignor to initiate the electronic assignment.
Immunobiology: The Immune System in Health & Disease Sixth Edition Chapter 11 Failures of Host Defense Mechanisms Copyright © 2005 by Garland Science Publishing.
© 2017 SlidePlayer.com Inc. All rights reserved.