HOW AND WHY TO LOVE CUCUMBER By Dana Scheider. Is This Your Programming Experience?

Slides:



Advertisements
Similar presentations
Testing Relational Database
Advertisements

Behavior Driven Test Development
xUnit Test Patterns (Some) xUnit Test Patterns (in practice) by Adam Czepil.
Test-First Programming. The tests should drive you to write the code, the reason you write code is to get a test to succeed, and you should only write.
C UCUMBER behavior driven development Presented by: Julian Togashi and Ryan Lewis CPSC 473.
CS487 Software Engineering Omar Aldawud
Local Touch – Global Reach The New Tester Matthew Eakin, Manager Managed Testing Practice Sogeti, USA.
Adding scalability to legacy PHP web applications Overview Mario A. Valdez-Ramirez.
1 Introducing Collaboration to Single User Applications A Survey and Analysis of Recent Work by Brian Cornell For Collaborative Systems Fall 2006.
EXtreme.NET Dr. Neil Roodyn. eXtreme.NET Who is Dr. Neil? MISSION: To increase the value of your Software Business Working with software for way too long.
Applied Software Project Management Andrew Stellman & Jennifer Greene Applied Software Project Management Applied Software.
Xtreme Programming. Software Life Cycle The activities that take place between the time software program is first conceived and the time it is finally.
ECE122 L17: Method Development and Testing April 5, 2007 ECE 122 Engineering Problem Solving with Java Lecture 17 Method Development and Testing.
U-Mail System Design Specification Joseph Woo, Chris Hacking, Alex Benson, Elliott Conant, Alex Meng, Michael Ratanapintha April 28,
Learn how SpecFlow enables you to do TDD with friction-free plain-English executable tests. Larry Apke Agile Expert
Living Requirements using Behavior Driven Development
Test Driven Development Derived from Dr. Fawcett’s notes Phil Pratt-Szeliga Fall 2009.
Introduction to Computer Technology
TDD,BDD and Unit Testing in Ruby
1 KAN’S INTRO AND OVERVIEW MODELS Ch1 & 2 in his book Steve Chenoweth, CSSE.
QWise software engineering – refactored! Testing, testing A first-look at the new testing capabilities in Visual Studio 2010 Mathias Olausson.
Test Driven Development An approach to writing better code Jimmy Zimmerman Intel Corporation.
Chapter 3 – Agile Software Development Lecture 2 1Chapter 3 Agile software development.
Background The Encyclopedio of Life (EOL) is an ROR open source project to create a free, online reference source and database for every one of the 1.8.
Behaviour Driven Development with Cucumber for Java.
IT Systems Analysis & Design
Chapter 3 Agile Software Development (2/2) Yonsei University 2 nd Semester, 2013 Sanghyun Park.
© BJSS Limited Going Agile UK TMF - April 2011 Mark Crowther, Test Consultant.
Understand Application Lifecycle Management
By Touseef Tahir Software Testing Basics. Today's Agenda Software Quality assurance Software Testing Software Test cases Software Test Plans Software.
© ALEXANDRE CUVA  VERSION 2.00 Test Driven Design.
Chapter 3 – Agile Software Development Lecture 2 1Chapter 3 Agile software development.
Guidelines for Paper Presentation Mei-Chen Yeh 03/30/2010.
Cyreath.co.uk Empirical Pragmatic Testing Copyright ©Mark Crowther 2009 An Introduction to Behaviour Driven Testing (BDT) [Originally presented to NMQA,
Automated Acceptance Testing and Continuous Delivery Larry Apke Agile Expert
TM Copyright © 2009 NMQA Ltd. Behaviour Driven Testing with.
Information Architecture & Design Week 3 Schedule -Syllabus Updates -Group Project Deliverables -IA Methodologies -Research Topic Presentations.
T Iteration demo T Iteration Demo Team Balboa I1 - Iteration
Presenting: Vivien Ibironke Ibiyemi Tools for becoming a better tester.
Use Cases CS 6961 – Lecture 4 Nathan Dykman. Neumont UniversityCS Lecture 102 Administration Homework 1 is due –Still reviewing the proposal, but.
Black Box Testing : The technique of testing without having any knowledge of the interior workings of the application is Black Box testing. The tester.
BEHAVIOR DRIVEN TEST DEVELOPMENT Specification by Example.
CSE 303 – Software Design and Architecture
(1) Test Driven Development Philip Johnson Collaborative Software Development Laboratory Information and Computer Sciences University of Hawaii Honolulu.
Extreme Programming. Extreme Programming (XP) Formulated in 1999 by Kent Beck, Ward Cunningham and Ron Jeffries Agile software development methodology.
BEHAVIOR DRIVEN TEST DEVELOPMENT Specification by Example All Rights Reserved - Sound Agile Consulting.
Phoenix Scrum User Group Simplifying Scrum Online May 21 st 2009.
Agenda: Overview of Agile testing Difference between Agile and traditional Methodology Agile Development Methodologies Extreme Programming Test Driven.
Refactoring and Integration Testing or Strategy, introduced reliably by TDD The power of automated tests.
Safety methods within Agile and RUP methods TORGRIM LAURITSEN BUCS project.
We Behatin’. INTRODUCTION Behat background 3 Behat prep Getting started
Ognjen Bajić Ana Roje Ivančić Ekobit Efficient Application Testing.
Applied Software Project Management SOFTWARE TESTING Applied Software Project Management 1.
User Stories > Big and Small
Applied Software Testing
Development Changes in Dynamics 365 for Finance and Operations
Behavior Driven Test Development
Applied Software Implementation & Testing
Advantages OF BDD Testing
Johanna Rothman Create Technical Excellence Chapter 9
Johanna Rothman Know What “Done” Means Chapter 11
TDD adoption plan 11/20/2018.
Test-driven development (TDD)
Unit 6: Application Development
A Global Trojan Solution
Open Source Tool Based Automation solution with Continuous Integration and end to end BDD Implementation Arun Krishnan - Automation Manager Maria Afzal-
Introduction to BDD. Introduction to BDD “BDD is a second-generation, outside-in, pull-based, multiple-stakeholder, multiple-scale, high-automation,
Move from Scripted Manual Testing to Scenario-Based Testing
Open Source Tool Based Automation solution with Continuous Integration and end to end BDD Implementation Arun Krishnan - Automation Manager Maria Afzal-
Presentation transcript:

HOW AND WHY TO LOVE CUCUMBER By Dana Scheider

Is This Your Programming Experience?

The RSpec Book The whole first part of The RSpec Book is about Cucumber.

Behavior-driven development is important and Cucumber is an excellent tool for the job. Thesis

Why I’m Here  Software testing is fun!  Cucumber is really fun!  Many people don’t grok Cucumber’s use cases  I’m tired of the way you roll your eyes at me when I tell you I use and contribute to Cucumber

Outline  What is (and isn’t) Cucumber?  Cucumber and behavior-driven development  Why some developers don’t like Cucumber  How to love Cucumber

I. What Cucumber Is II. Illustrations III. What Cucumber Isn’t What Is Cucumber?

 Acceptance testing tool  Composed of “features” and “scenarios” written in Gherkin DSL, and “step definitions” written in Cucumber step definition DSL  Understandable to nontechnical team members  Creates documentation as you write your tests

Every Cucumber feature has one or more scenarios, which highlight different use cases, types of input, application states, etc. State is maintained within each scenario, and individual steps, beginning with ‘Given’, ‘When’, ‘Then’, and ‘And’ keywords, run in the context created by previous steps in the same scenario. Gherkin Example

Each step has a step definition that either (A) defines changes in the environment, (B) triggers UI events, or (C) sets an expectation using the RSpec expectations API. If the change in the environment/context cannot be made, the UI event cannot be effected, or the expectation is not met, any scenario containing that step fails. Cucumber Step Definition Example

What Isn’t Cucumber?  Unit testing tool  Replacement for unit testing  Low-level  Stateless

I. What Is BDD? II. Why BDD? III. What is Integration Testing? IV. Example with Cucumber & Rspec Cucumber and BDD

What Is BDD?  Focused on API the user uses  Combines unit and integration/acceptance testing  Tests are written first  Minimal planning up front

The BDD/TDD Cycle

Why BDD?  You need to know what your software does  Users need to know your software works as advertised  Testing enables you to take more risks in the development process  Reduces technical debt  If the code isn’t important enough to test, is it important enough to deploy or deliver to clients?

What Is Acceptance Testing?  High level  Not concerned with details of implementation  Mimics how actual users use the software  Covers as much of the API as possible

Relationship to Unit Testing  Covers the program as a whole  Tests from the user’s perspective  Not concerned with implementation  Covers specific parts of the program  Tests things the user can’t see  Concerned with how individual parts of the code work & interact Acceptance TestingUnit Testing

Each system needs multiple integration/acceptance tests covering user-facing functionality. As that functionality is developed, unit tests are added to test implementation-specific elements that are needed to support the API. Software Suite Structure

Unit testing and integration testing have a both/and, not either/or, relationship Relationship to Unit Testing

Cucumber and BDD  Use Cucumber for acceptance/integration tests only  Cucumber features determine what unit tests are needed  If unit tests pass, Cucumber features should pass, too  If unit tests fail, Cucumber features should fail, too  Cucumber provides direction for behavior-driven workflows

I. Things about testing/TDD/BDD II. Things about Cucumber III. Things about developers Why Some Devs Don’t Like It

Things about TDD/BDD  Takes more time before you start coding  Makes you look at software from user’s POV  Can be daunting to break a complex problem down into the smallest possible part  Feels unnecessary, especially at first

Things about Cucumber  Uses regular expressions*  Natural language can seem needlessly clunky  Tests can take a longer time than with other frameworks  Can be hard to organize feature and step- definition files * You can use strings instead if you REALLY hate the regular expressions

Things about Developers  Already using testing tools that work better for them  Trying to use Cucumber for unit tests  Not taking advantage of the tools in Cucumber’s rich ecosystem  Unable to articulate in plain, natural, language what their software does  Reluctant to bring nontechnical team members and stakeholders into the fold

I. Conceptualizing Cucumber II. Contextualizing Cucumber III. Adopting Effective Workflows IV. Organizing Your Features V. Taking Advantage of the Ecosystem How to Love Cucumber

Conceptualizing Cucumber  Cucumber is for integration testing  Use Cucumber to write documentation and ensure your software adheres to it  Use your imagination to see your software from the perspective of your eventual user  Explain your use cases and break the explanations down into Cucumber steps

Conceptualizing Cucumber

Contextualizing Cucumber  Don’t stop unit testing!  Let Cucumber features guide development process  Take advantage of Cucumber’s ability to maintain state between steps  Remember Cucumber is about the user, not the dev  Use Cucumber’s natural-language style to reach consensus with nontechnical stakeholders about specs and deliverables

Adopting Effective Workflows  Write Cucumber features before writing unit tests  Discuss Cucumber features with nontechnical team members or stakeholders before writing unit tests  If unit tests pass and features fail, write more unit tests  If unit tests fail and features pass, consider refactoring to remove redundant or unneeded code  Refactor liberally  Use continuous integration/delivery!

I. Summary I. TDD/BDD is cool! II. Cucumber’s pretty cool too! II. Questions? Conclusion

What TDD & Cucumber Can Bring to Your Projects  Better code quality  Less code  Less technical debt  Built-in documentation known to be accurate  Knowledge about what your app brings to users, in language users can understand  Easy communication with nontechnical people  Fun and happiness!

Github: danascheider Dana Scheider