SlideShare a Scribd company logo
BDD – By Examples
Behavior Driven Development with Selenium/ Cucumber-JVM
Nalin Goonawardana
The audience



Automated acceptance testing?



Agile/Scrum?



CI?



BDD?
BDD/BDT – Connecting the dots
Agile

Cucumber
User Stories

UATDD
Features

Gherkin
Scenarios

BDD-2003

Step
Definitions

TDD
Steps

Dan North
Thought
Works

Jason
Huggins

JBehave
CucumberJVM

Specification
by Example

Selenium2004
DSL



Business language --- DSL



Specification by Example



On the other hand a good functional test tells a story!
The concept of ―Xdriven‖




You are driven by something to do something or achieve something.
i.e. What do you set as the guiding line that governs how you establish
some other task!



Few examples: Capability driven development



Model driven development



Test driven development



Passion driven development



Requirement driven development?



What drives us to do something or what you do first!



Of course it is not ―Bug driven development where the developer only get
to know the expected requirement through a bug!
How close we are - Requirements

User
The creation of functional tests and "features"
User Interface

Expected behavior
User acceptance Testing
Functional Testing
Integration testing
Service layer testing

Module

Module level testing/Unit te

Class
Unit?-method?

The creation of unit tests and "technical" code

Unit testing

Developer
What is wrong with Unit tests



Developer testing Vs. Behavior compliance.

Requirement
Or Expected behavior
BA/QA/User
Explicit collaboration effort that
May vary

Developer

Verification and
validation at
unit test level
Gaps and Cracks

Bugs

One common set of verifications that collaboratively making passed
as the exit criteria or done-ness criteria
Gaps and Cracks Contd..



The gap between unit tests : high-level software requirements, low-level
technical details

Behavior

Requirement
Executable Specification - User stories










Executable specifications
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
What makes BDD different?






It technically Integrates the requirement to the SDLC.
It demands developer to align the development with user requirement
from the beginning.
It is a engineering work bench that support requirement driven
deveolopment.
BDD and BDT
How do we implement this?



Process or workflow alignment



Technical solution
The work-flow

Feature > Scenarios

Feature/Behavior

Test Fixtures

App implementation

Acceptance
BDD phases

Elicitation – BA/Customer (Product)

Elaboration – BA/QA (Product/QA)

Implementation of feature - Dev

Implementation of steps - QA

Validation(Exploratory+BDT)

Acceptance(Product owner-Demo)
The framework anatomy
Page Object layer (Pages and Elements)
get_element1
Page One

Page Two

Page Three
get_element
2

Basic Action Layer

Composite action Layer (Helper abstract layer
-Business flow layer)
[Transferring browser
control over page objects]

action_element1

action_element2

Starting comp action
Intermediate Comp Action
Exiting comp Action

Step Definition Layer (Collection of methods annotated in
Cucumber/Gherkin - Given, When, Then, But or And)

Junit executor class

Feature Layer (Actual test cases represented as scenarios written in
annotated names in step definition class.)
The framework anatomy contd..

Page Object layer (Pages and Elements)

Basic Action Layer

Composite action Layer (Helper abstract layer
-Business flow layer)
Step Definition Layer (Collection of methods
annotated in
Cucumber/Gherkin
- Given, When, Then, But or And)

Feature Layer (Actual test cases represented
as scenarios written in
annotated names in step definition class.)
TDD process and it’s roots
Specify
Behaviour

Write
little
test

Refactor

Implement
the App
complying
to the
Behaviour

Watch
test fail

Get test
pass

Wire steps
with
automation
code
Into details



Cucumber



Gherkin
The jargon








Feature : Piece of system functionality that delivers value.
User story : Vertical functional slice of a feature that can be delivered
independently
Scenario : One key example for a feature in the feature file. This amounts
to the main functional flows/ behaviors * critical data (derived through a
test design technique)
Step: Domain language phrases which can be combined to create
scenarios.
Cucumber






Cucumber is a testing framework that speaks the language of Gherkin.
It wires the .feature or the executable spec to its corresponding test
implementation the ―step definitions‖.
Using Cucumber doesnt mean you are practicing BDD!
Cucumber-JVM and the tech stack

• Cucumber-JVM is a pure Java implementation of Cucumber, with native
support for the most popular JVM languages: Java, Scala, Groovy, Clojure,
Rhino, Jython and JRuby.
• Selenium Web Driver : Java : Junit : Maven
Gherkin in two mins



Gherkin is the language that Cucumber understands.



purposes — documentation and automated tests



it’s talking to you, telling you what code you should write.



Single Gherkin source file contains a description of a single feature.



Source files have .feature extension.
Gherkin in two mins …..



Features,User Stories, Scenarios and steps



line-oriented language that uses indentation to define structure



Line endings terminate statements



Either spaces or tabs may be used for indentation



lines start with a keyword (Feature,Background,Scenario,Scenario
Template,Given,When,Then,And,But)



Comment lines are allowed anywhere #



Regular expressions



Tables
Gherkin in two mins ….. Keywords



Given : Pre condition



When: primary action of a scenario



Then : Post condition, expected observable outcomes.



And, But

If you have several Given, When or Then steps.
Data driven

Scenario Outline: Login Success and Failure
Given I navigate to the mock application
When I try to login with '<type>' credentials
Then I should see that I logged in '<status>'
Examples:
| type
| valid
| invalid

| status
|
| successfully |
| unsuccessfully|
Setting up the IDE



Pre conditions:



IntelliJ IDEA 12 Community Edition

In the IDE add the following plugins;
Settings> IDE settings > Plugins > Install JetBrains Plugins > Gherkin V1.1
Settings> IDE settings > Plugins > Install JetBrains Plugins > Cucumber for Groovy V1.0
Settings> IDE settings > Plugins > Install JetBrains Plugins > Cucumber for Java V1.0
IDE features



1. Code Completion (Step definition and Gherking syntax support)



2. Cucumber Framework Support



3. Drill down from *.feature file to step definition



4. Code Formatting



5. Junit runner support
Framework Changes Step 1 – Adding Maven Dependencies



Simple five steps approach in the framework level changes



Assumptions



Existing Java/Junit/Maven/Web Driver based test framework.



Or Create an empty maven project



Apart from the junit/Selenium deps add the following deps to the maven
pom file
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-java</artifactId>
<version>1.1.4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-junit</artifactId>
<version>1.1.5</version>
<scope>test</scope>
</dependency>
Framework Changes Step 2 - Set up package structure
Framework Changes Step 3: Add the junit runner class
Framework Changes Step 4 - Add the step definition class
Framework Changes Step 5 - Add the feature file
The role of the CI dashboard



Create a view in the name of the sprint and add the junit runner class to
separate new projects and let every one know where we are!
Demo



Sprint X starts



Scenarios were written



Create CI project dashboard for Sprint X and initiate.



QA : Write the test fixture and implement any step definitions. Use mock
elements(xpath or id etc.) refering to the wire frames and create the page
objects. Replace them with the real element references as soon the
details available.



Dev: Implement the Code



Tests getting passed progressively



Done: All tests are passed + Planned manual tests are executed.
Auto generated code skeleton

@Given("^add (d+) and (d+)$")
public void add_and(int arg1, int arg2) throws Throwable {
// Express the Regexp above with the code you wish you had
throw new PendingException();
}
The transition






In the original proposal the transition would be just using ―should‖ instead
of ―test‖ in the unit testing!
User story: "As a [role] I want [feature] so that [benefit]".
Scenario: ―Given [initial context], when [event occurs], then [ensure some
outcomes]‖



Test method names should be sentences



A simple sentence template keeps test methods focused



An expressive test name is helpful when a test fails



―Behavior‖ is a more useful word than ―test‖



Requirements are behavior,too



Acceptance criteria should be executable
Agile Scrum Alignment



Feature : Backlog item



Scenario: Test case



Donness : Built in - Green report + Manual expert/exploratory testing sign
off.



Continuous collaboration : BDD enforces it.



Continuous integration : BDD enforces it. (Part of the build.)



Recommends automation : BDD enforces it.



Just enough/living documentation that serve multiple purposes.



Always know how much is remaining.
Manual testing?



Expertize driven testing



Exploratory testing



Regression ?



Limitations of automation ?
Can we only do BDT without BDD



Yes and a No!



BDT can be identified as the means of realizing BDD.
Some more advantages



Non technical



BA's Product owners, OPS, Dev, QA speaking the same language



Defines Doneness criteria



Automated Regression Test suites.



No compilation issues only runtime.



User expected behavior conformance is maintained from the beginning...
Advantages Contd…



Tests can become truly useful documentation



Helps you to separate "what?" from "how?"



Purposely small command-set is simple to learn



Separating requirements from implementation helps refactoring



Specifications can be as thorough as unit tests



Specifications can be hooked in at different levels



Agreeing details up-front allows finer control over scope



Test coverage no longer relies on developer self-discipline



automatic generation of technical and end user documentation from BDD
"specifications"
The collaboration

• In BDD a significant portion of "functional documentation" defined in the
form of ―User Stories‖.
• "tests", a BDD practitioner will prefer the terms "scenario" and
"specification".
• "functional tests", the preferred term will be "specifications of the product's
behavior".
• "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"
You are already a BDD practitioner



If you are practicing TDD properly



BDD, often described as ―TDD done well‖



User focused TDD
TOOLS



JSpec - JavaScript Behavior Driven Development



SpecFlow - Pragmatic BDD for .NET
•
•
•
•
•
•
•
•

FitNesse
Cucumber (software)
Framework for Integrated Test
JBehave
Robot Framework
Concordion
specs2
specflow
BDT is a paradigm shift for QA

• Reclaiming the QA role within the Agile world
• No tests but scenarios!
• Technical convergence
• Early/Parallel automation.
• Just enough Engineering practices!
• Tests frameworks without layers ! Record and play !
• Highly engaged requirement deal
• Its not about the tools but about the practices !
Future implementations



API Testing (In conjunction with Rest Assured)



Performance testing (In conjunction with Jmeter)



Consolidated online CASE tool?

A communication and collaboration framework for developers, QA and nontechnical or business participants in a software project.
More

• http://aslakhellesoy.com/post/20006051268/cucumber-jvm-1-0-0
• http://www.ibm.com/developerworks/opensource/library/a-automatingria/index.html
• RSpec, Cucumber and GivWenZen(Fitness)
• FitNess
• http://fitnesse.org/
• Xebium : Combine the power of Selenium
• http://xebia.github.io/Xebium/
• BDD original proposal
• http://dannorth.net/introducing-bdd/
Q&A
Thanks!

Nalin Goonawardana
http://nalingski.blogspot.com/
Leapset Inc.
http://www.leapset.com/

http://www.meetup.com/colombo-selenium/events/165499102/
Ad

More Related Content

What's hot (20)

Behavior-Driven Development and Automation Testing Using Cucumber Framework W...
Behavior-Driven Development and Automation Testing Using Cucumber Framework W...Behavior-Driven Development and Automation Testing Using Cucumber Framework W...
Behavior-Driven Development and Automation Testing Using Cucumber Framework W...
KMS Technology
 
Behavior Driven Development Testing (BDD)
Behavior Driven Development Testing (BDD)Behavior Driven Development Testing (BDD)
Behavior Driven Development Testing (BDD)
Dignitas Digital Pvt. Ltd.
 
Bdd – with cucumber and gherkin
Bdd – with cucumber and gherkinBdd – with cucumber and gherkin
Bdd – with cucumber and gherkin
Arati Joshi
 
Serenity-BDD training
Serenity-BDD trainingSerenity-BDD training
Serenity-BDD training
Savvycom Savvycom
 
Selenium + Specflow
Selenium + SpecflowSelenium + Specflow
Selenium + Specflow
cromwellryan
 
AngularJS Beginner Day One
AngularJS Beginner Day OneAngularJS Beginner Day One
AngularJS Beginner Day One
Troy Miles
 
Automation solution using jbehave, selenium and hudson
Automation solution using jbehave, selenium and hudsonAutomation solution using jbehave, selenium and hudson
Automation solution using jbehave, selenium and hudson
Pankaj Nakhat
 
Behavior Driven GUI Testing
Behavior Driven GUI TestingBehavior Driven GUI Testing
Behavior Driven GUI Testing
Reginald Stadlbauer
 
BBD Hands-on with Python. Practical Hands-on Workshop about "Behaviour Driven...
BBD Hands-on with Python. Practical Hands-on Workshop about "Behaviour Driven...BBD Hands-on with Python. Practical Hands-on Workshop about "Behaviour Driven...
BBD Hands-on with Python. Practical Hands-on Workshop about "Behaviour Driven...
Hemmerling
 
Rspec and Capybara Intro Tutorial at RailsConf 2013
Rspec and Capybara Intro Tutorial at RailsConf 2013Rspec and Capybara Intro Tutorial at RailsConf 2013
Rspec and Capybara Intro Tutorial at RailsConf 2013
Brian Sam-Bodden
 
PHPConf.asia 2016 - BDD with Behat for Beginners
PHPConf.asia 2016 - BDD with Behat for BeginnersPHPConf.asia 2016 - BDD with Behat for Beginners
PHPConf.asia 2016 - BDD with Behat for Beginners
Adam Englander
 
2015 in tothebox-introtddbdd
2015 in tothebox-introtddbdd2015 in tothebox-introtddbdd
2015 in tothebox-introtddbdd
ColdFusionConference
 
QA Fest 2015. Сергей Пирогов. Красивые JBehave отчеты
QA Fest 2015. Сергей Пирогов. Красивые JBehave отчетыQA Fest 2015. Сергей Пирогов. Красивые JBehave отчеты
QA Fest 2015. Сергей Пирогов. Красивые JBehave отчеты
QAFest
 
BDD using JBehave
BDD using JBehaveBDD using JBehave
BDD using JBehave
Ajit Skanda Kumaraswamy
 
From Good to Great: Functional and Acceptance Testing in WordPress.
From Good to Great: Functional and Acceptance Testing in WordPress.From Good to Great: Functional and Acceptance Testing in WordPress.
From Good to Great: Functional and Acceptance Testing in WordPress.
David Aguilera
 
Intro to TDD and BDD
Intro to TDD and BDDIntro to TDD and BDD
Intro to TDD and BDD
Jason Noble
 
BDD with SpecFlow and Selenium
BDD with SpecFlow and SeleniumBDD with SpecFlow and Selenium
BDD with SpecFlow and Selenium
Liraz Shay
 
Beginning AngularJS
Beginning AngularJSBeginning AngularJS
Beginning AngularJS
Troy Miles
 
Jbehave- Basics to Advance
Jbehave- Basics to AdvanceJbehave- Basics to Advance
Jbehave- Basics to Advance
Ravinder Singh
 
Cucumber_Training_ForQA
Cucumber_Training_ForQACucumber_Training_ForQA
Cucumber_Training_ForQA
Meenakshi Singhal
 
Behavior-Driven Development and Automation Testing Using Cucumber Framework W...
Behavior-Driven Development and Automation Testing Using Cucumber Framework W...Behavior-Driven Development and Automation Testing Using Cucumber Framework W...
Behavior-Driven Development and Automation Testing Using Cucumber Framework W...
KMS Technology
 
Bdd – with cucumber and gherkin
Bdd – with cucumber and gherkinBdd – with cucumber and gherkin
Bdd – with cucumber and gherkin
Arati Joshi
 
Selenium + Specflow
Selenium + SpecflowSelenium + Specflow
Selenium + Specflow
cromwellryan
 
AngularJS Beginner Day One
AngularJS Beginner Day OneAngularJS Beginner Day One
AngularJS Beginner Day One
Troy Miles
 
Automation solution using jbehave, selenium and hudson
Automation solution using jbehave, selenium and hudsonAutomation solution using jbehave, selenium and hudson
Automation solution using jbehave, selenium and hudson
Pankaj Nakhat
 
BBD Hands-on with Python. Practical Hands-on Workshop about "Behaviour Driven...
BBD Hands-on with Python. Practical Hands-on Workshop about "Behaviour Driven...BBD Hands-on with Python. Practical Hands-on Workshop about "Behaviour Driven...
BBD Hands-on with Python. Practical Hands-on Workshop about "Behaviour Driven...
Hemmerling
 
Rspec and Capybara Intro Tutorial at RailsConf 2013
Rspec and Capybara Intro Tutorial at RailsConf 2013Rspec and Capybara Intro Tutorial at RailsConf 2013
Rspec and Capybara Intro Tutorial at RailsConf 2013
Brian Sam-Bodden
 
PHPConf.asia 2016 - BDD with Behat for Beginners
PHPConf.asia 2016 - BDD with Behat for BeginnersPHPConf.asia 2016 - BDD with Behat for Beginners
PHPConf.asia 2016 - BDD with Behat for Beginners
Adam Englander
 
QA Fest 2015. Сергей Пирогов. Красивые JBehave отчеты
QA Fest 2015. Сергей Пирогов. Красивые JBehave отчетыQA Fest 2015. Сергей Пирогов. Красивые JBehave отчеты
QA Fest 2015. Сергей Пирогов. Красивые JBehave отчеты
QAFest
 
From Good to Great: Functional and Acceptance Testing in WordPress.
From Good to Great: Functional and Acceptance Testing in WordPress.From Good to Great: Functional and Acceptance Testing in WordPress.
From Good to Great: Functional and Acceptance Testing in WordPress.
David Aguilera
 
Intro to TDD and BDD
Intro to TDD and BDDIntro to TDD and BDD
Intro to TDD and BDD
Jason Noble
 
BDD with SpecFlow and Selenium
BDD with SpecFlow and SeleniumBDD with SpecFlow and Selenium
BDD with SpecFlow and Selenium
Liraz Shay
 
Beginning AngularJS
Beginning AngularJSBeginning AngularJS
Beginning AngularJS
Troy Miles
 
Jbehave- Basics to Advance
Jbehave- Basics to AdvanceJbehave- Basics to Advance
Jbehave- Basics to Advance
Ravinder Singh
 

Viewers also liked (20)

Behavior Driven Development and Automation Testing Using Cucumber
Behavior Driven Development and Automation Testing Using CucumberBehavior Driven Development and Automation Testing Using Cucumber
Behavior Driven Development and Automation Testing Using Cucumber
KMS Technology
 
Behavior Driven Development
Behavior Driven DevelopmentBehavior Driven Development
Behavior Driven Development
Liz Keogh
 
Introduction to Behaviour Driven Development
Introduction to Behaviour Driven DevelopmentIntroduction to Behaviour Driven Development
Introduction to Behaviour Driven Development
Christophe Achouiantz
 
Perl Behavior Driven Development (BDD)
Perl Behavior Driven Development (BDD)Perl Behavior Driven Development (BDD)
Perl Behavior Driven Development (BDD)
Tudor Constantin
 
Behaviour Driven Development
Behaviour Driven DevelopmentBehaviour Driven Development
Behaviour Driven Development
Richard Ruiter
 
Behavior Driven Development Pros and Cons
Behavior Driven Development Pros and ConsBehavior Driven Development Pros and Cons
Behavior Driven Development Pros and Cons
extentconf Tsoy
 
Scrum + Behavior Driven Development (BDD) - Colombo
Scrum + Behavior Driven Development (BDD) - ColomboScrum + Behavior Driven Development (BDD) - Colombo
Scrum + Behavior Driven Development (BDD) - Colombo
Naveen Kumar Singh
 
Introduction to TDD and BDD
Introduction to TDD and BDDIntroduction to TDD and BDD
Introduction to TDD and BDD
Luis García Castro
 
Behaviour Driven Development with SpecFlow
Behaviour Driven Development with SpecFlowBehaviour Driven Development with SpecFlow
Behaviour Driven Development with SpecFlow
Pascal Laurin
 
Behavior driven development for Mobile apps
Behavior driven development for Mobile appsBehavior driven development for Mobile apps
Behavior driven development for Mobile apps
Geert van der Cruijsen
 
Automate WebServices Rest API (testing) using Java
Automate WebServices Rest API (testing) using JavaAutomate WebServices Rest API (testing) using Java
Automate WebServices Rest API (testing) using Java
ayman diab
 
Quality Jam: BDD, TDD and ATDD for the Enterprise
Quality Jam: BDD, TDD and ATDD for the EnterpriseQuality Jam: BDD, TDD and ATDD for the Enterprise
Quality Jam: BDD, TDD and ATDD for the Enterprise
QASymphony
 
The WHY behind TDD/BDD and the HOW with RSpec
The WHY behind TDD/BDD and the HOW with RSpecThe WHY behind TDD/BDD and the HOW with RSpec
The WHY behind TDD/BDD and the HOW with RSpec
Ben Mabey
 
Bdd with Cucumber and Mocha
Bdd with Cucumber and MochaBdd with Cucumber and Mocha
Bdd with Cucumber and Mocha
Atish Narlawar
 
Gherkin for test automation in agile
Gherkin for test automation in agileGherkin for test automation in agile
Gherkin for test automation in agile
Viresh Doshi
 
Outside In - Behaviour Driven Development (BDD)
Outside In - Behaviour Driven Development (BDD)Outside In - Behaviour Driven Development (BDD)
Outside In - Behaviour Driven Development (BDD)
Naresh Jain
 
An introduction to Behavior-Driven Development (BDD)
An introduction to Behavior-Driven Development (BDD)An introduction to Behavior-Driven Development (BDD)
An introduction to Behavior-Driven Development (BDD)
Suman Guha
 
Testing RESTful web services with REST Assured
Testing RESTful web services with REST AssuredTesting RESTful web services with REST Assured
Testing RESTful web services with REST Assured
Bas Dijkstra
 
Rest assured
Rest assuredRest assured
Rest assured
Yaniv Rodenski
 
Tech Meetup: How to build a Rest API in Java
Tech Meetup: How to build a Rest API in JavaTech Meetup: How to build a Rest API in Java
Tech Meetup: How to build a Rest API in Java
Santex Group
 
Behavior Driven Development and Automation Testing Using Cucumber
Behavior Driven Development and Automation Testing Using CucumberBehavior Driven Development and Automation Testing Using Cucumber
Behavior Driven Development and Automation Testing Using Cucumber
KMS Technology
 
Behavior Driven Development
Behavior Driven DevelopmentBehavior Driven Development
Behavior Driven Development
Liz Keogh
 
Introduction to Behaviour Driven Development
Introduction to Behaviour Driven DevelopmentIntroduction to Behaviour Driven Development
Introduction to Behaviour Driven Development
Christophe Achouiantz
 
Perl Behavior Driven Development (BDD)
Perl Behavior Driven Development (BDD)Perl Behavior Driven Development (BDD)
Perl Behavior Driven Development (BDD)
Tudor Constantin
 
Behaviour Driven Development
Behaviour Driven DevelopmentBehaviour Driven Development
Behaviour Driven Development
Richard Ruiter
 
Behavior Driven Development Pros and Cons
Behavior Driven Development Pros and ConsBehavior Driven Development Pros and Cons
Behavior Driven Development Pros and Cons
extentconf Tsoy
 
Scrum + Behavior Driven Development (BDD) - Colombo
Scrum + Behavior Driven Development (BDD) - ColomboScrum + Behavior Driven Development (BDD) - Colombo
Scrum + Behavior Driven Development (BDD) - Colombo
Naveen Kumar Singh
 
Behaviour Driven Development with SpecFlow
Behaviour Driven Development with SpecFlowBehaviour Driven Development with SpecFlow
Behaviour Driven Development with SpecFlow
Pascal Laurin
 
Behavior driven development for Mobile apps
Behavior driven development for Mobile appsBehavior driven development for Mobile apps
Behavior driven development for Mobile apps
Geert van der Cruijsen
 
Automate WebServices Rest API (testing) using Java
Automate WebServices Rest API (testing) using JavaAutomate WebServices Rest API (testing) using Java
Automate WebServices Rest API (testing) using Java
ayman diab
 
Quality Jam: BDD, TDD and ATDD for the Enterprise
Quality Jam: BDD, TDD and ATDD for the EnterpriseQuality Jam: BDD, TDD and ATDD for the Enterprise
Quality Jam: BDD, TDD and ATDD for the Enterprise
QASymphony
 
The WHY behind TDD/BDD and the HOW with RSpec
The WHY behind TDD/BDD and the HOW with RSpecThe WHY behind TDD/BDD and the HOW with RSpec
The WHY behind TDD/BDD and the HOW with RSpec
Ben Mabey
 
Bdd with Cucumber and Mocha
Bdd with Cucumber and MochaBdd with Cucumber and Mocha
Bdd with Cucumber and Mocha
Atish Narlawar
 
Gherkin for test automation in agile
Gherkin for test automation in agileGherkin for test automation in agile
Gherkin for test automation in agile
Viresh Doshi
 
Outside In - Behaviour Driven Development (BDD)
Outside In - Behaviour Driven Development (BDD)Outside In - Behaviour Driven Development (BDD)
Outside In - Behaviour Driven Development (BDD)
Naresh Jain
 
An introduction to Behavior-Driven Development (BDD)
An introduction to Behavior-Driven Development (BDD)An introduction to Behavior-Driven Development (BDD)
An introduction to Behavior-Driven Development (BDD)
Suman Guha
 
Testing RESTful web services with REST Assured
Testing RESTful web services with REST AssuredTesting RESTful web services with REST Assured
Testing RESTful web services with REST Assured
Bas Dijkstra
 
Tech Meetup: How to build a Rest API in Java
Tech Meetup: How to build a Rest API in JavaTech Meetup: How to build a Rest API in Java
Tech Meetup: How to build a Rest API in Java
Santex Group
 
Ad

Similar to Behavior Driven Development by Example (20)

CucumberSeleniumWD
CucumberSeleniumWDCucumberSeleniumWD
CucumberSeleniumWD
Vikas Sarin
 
Automation test framework with cucumber – BDD
Automation test framework with cucumber – BDDAutomation test framework with cucumber – BDD
Automation test framework with cucumber – BDD
123abcda
 
Gherkin /BDD intro
Gherkin /BDD introGherkin /BDD intro
Gherkin /BDD intro
Ryan Thomas Hewitt★CSM★CSPO★ITIL
 
cucumber harpal.pdf
cucumber harpal.pdfcucumber harpal.pdf
cucumber harpal.pdf
VennelaVasupilli
 
Spec(ing) Out Your Workflow with SpecFlow
Spec(ing) Out Your Workflow with SpecFlowSpec(ing) Out Your Workflow with SpecFlow
Spec(ing) Out Your Workflow with SpecFlow
Sarah Dutkiewicz
 
Coding Naked
Coding NakedCoding Naked
Coding Naked
Caleb Jenkins
 
BDD and Test Automation in Evalutionary Product Suite
BDD and Test Automation in Evalutionary Product SuiteBDD and Test Automation in Evalutionary Product Suite
BDD and Test Automation in Evalutionary Product Suite
Lasantha Ranaweera
 
Introducing BDD and TDD with Cucumber
Introducing BDD and TDD with CucumberIntroducing BDD and TDD with Cucumber
Introducing BDD and TDD with Cucumber
Knoldus Inc.
 
Behaviour Driven Development V 0.1
Behaviour Driven Development V 0.1Behaviour Driven Development V 0.1
Behaviour Driven Development V 0.1
willmation
 
Agile Software Development in Practice - A Developer Perspective
Agile Software Development in Practice - A Developer PerspectiveAgile Software Development in Practice - A Developer Perspective
Agile Software Development in Practice - A Developer Perspective
Wee Witthawaskul
 
Qtp interview questions
Qtp interview questionsQtp interview questions
Qtp interview questions
Ramu Palanki
 
Qtp interview questions
Qtp interview questionsQtp interview questions
Qtp interview questions
Ramu Palanki
 
Useful practices of creation automatic tests by using cucumber jvm
Useful practices of creation automatic tests by using cucumber jvmUseful practices of creation automatic tests by using cucumber jvm
Useful practices of creation automatic tests by using cucumber jvm
Anton Shapin
 
Enter the mind of an Agile Developer
Enter the mind of an Agile DeveloperEnter the mind of an Agile Developer
Enter the mind of an Agile Developer
BSGAfrica
 
Automated Acceptance Tests & Tool choice
Automated Acceptance Tests & Tool choiceAutomated Acceptance Tests & Tool choice
Automated Acceptance Tests & Tool choice
toddbr
 
Testing of React JS app
Testing of React JS appTesting of React JS app
Testing of React JS app
Aleks Zinevych
 
BDD WITH CUCUMBER AND JAVA
BDD WITH CUCUMBER AND JAVABDD WITH CUCUMBER AND JAVA
BDD WITH CUCUMBER AND JAVA
Srinivas Katakam
 
BDD Selenium for Agile Teams - User Stories
BDD Selenium for Agile Teams - User StoriesBDD Selenium for Agile Teams - User Stories
BDD Selenium for Agile Teams - User Stories
Sauce Labs
 
Manual testing1
Manual testing1Manual testing1
Manual testing1
Raghu Sirka
 
QA Automation Engineer
QA Automation EngineerQA Automation Engineer
QA Automation Engineer
MdHasan872214
 
CucumberSeleniumWD
CucumberSeleniumWDCucumberSeleniumWD
CucumberSeleniumWD
Vikas Sarin
 
Automation test framework with cucumber – BDD
Automation test framework with cucumber – BDDAutomation test framework with cucumber – BDD
Automation test framework with cucumber – BDD
123abcda
 
Spec(ing) Out Your Workflow with SpecFlow
Spec(ing) Out Your Workflow with SpecFlowSpec(ing) Out Your Workflow with SpecFlow
Spec(ing) Out Your Workflow with SpecFlow
Sarah Dutkiewicz
 
BDD and Test Automation in Evalutionary Product Suite
BDD and Test Automation in Evalutionary Product SuiteBDD and Test Automation in Evalutionary Product Suite
BDD and Test Automation in Evalutionary Product Suite
Lasantha Ranaweera
 
Introducing BDD and TDD with Cucumber
Introducing BDD and TDD with CucumberIntroducing BDD and TDD with Cucumber
Introducing BDD and TDD with Cucumber
Knoldus Inc.
 
Behaviour Driven Development V 0.1
Behaviour Driven Development V 0.1Behaviour Driven Development V 0.1
Behaviour Driven Development V 0.1
willmation
 
Agile Software Development in Practice - A Developer Perspective
Agile Software Development in Practice - A Developer PerspectiveAgile Software Development in Practice - A Developer Perspective
Agile Software Development in Practice - A Developer Perspective
Wee Witthawaskul
 
Qtp interview questions
Qtp interview questionsQtp interview questions
Qtp interview questions
Ramu Palanki
 
Qtp interview questions
Qtp interview questionsQtp interview questions
Qtp interview questions
Ramu Palanki
 
Useful practices of creation automatic tests by using cucumber jvm
Useful practices of creation automatic tests by using cucumber jvmUseful practices of creation automatic tests by using cucumber jvm
Useful practices of creation automatic tests by using cucumber jvm
Anton Shapin
 
Enter the mind of an Agile Developer
Enter the mind of an Agile DeveloperEnter the mind of an Agile Developer
Enter the mind of an Agile Developer
BSGAfrica
 
Automated Acceptance Tests & Tool choice
Automated Acceptance Tests & Tool choiceAutomated Acceptance Tests & Tool choice
Automated Acceptance Tests & Tool choice
toddbr
 
Testing of React JS app
Testing of React JS appTesting of React JS app
Testing of React JS app
Aleks Zinevych
 
BDD WITH CUCUMBER AND JAVA
BDD WITH CUCUMBER AND JAVABDD WITH CUCUMBER AND JAVA
BDD WITH CUCUMBER AND JAVA
Srinivas Katakam
 
BDD Selenium for Agile Teams - User Stories
BDD Selenium for Agile Teams - User StoriesBDD Selenium for Agile Teams - User Stories
BDD Selenium for Agile Teams - User Stories
Sauce Labs
 
QA Automation Engineer
QA Automation EngineerQA Automation Engineer
QA Automation Engineer
MdHasan872214
 
Ad

Recently uploaded (20)

Role of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered ManufacturingRole of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered Manufacturing
Andrew Leo
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 
Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.
hpbmnnxrvb
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 
Role of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered ManufacturingRole of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered Manufacturing
Andrew Leo
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 
Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.
hpbmnnxrvb
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 

Behavior Driven Development by Example

  • 1. BDD – By Examples Behavior Driven Development with Selenium/ Cucumber-JVM Nalin Goonawardana
  • 2. The audience  Automated acceptance testing?  Agile/Scrum?  CI?  BDD?
  • 3. BDD/BDT – Connecting the dots Agile Cucumber User Stories UATDD Features Gherkin Scenarios BDD-2003 Step Definitions TDD Steps Dan North Thought Works Jason Huggins JBehave CucumberJVM Specification by Example Selenium2004
  • 4. DSL  Business language --- DSL  Specification by Example  On the other hand a good functional test tells a story!
  • 5. The concept of ―Xdriven‖   You are driven by something to do something or achieve something. i.e. What do you set as the guiding line that governs how you establish some other task!  Few examples: Capability driven development  Model driven development  Test driven development  Passion driven development  Requirement driven development?  What drives us to do something or what you do first!  Of course it is not ―Bug driven development where the developer only get to know the expected requirement through a bug!
  • 6. How close we are - Requirements User The creation of functional tests and "features" User Interface Expected behavior User acceptance Testing Functional Testing Integration testing Service layer testing Module Module level testing/Unit te Class Unit?-method? The creation of unit tests and "technical" code Unit testing Developer
  • 7. What is wrong with Unit tests  Developer testing Vs. Behavior compliance. Requirement Or Expected behavior BA/QA/User Explicit collaboration effort that May vary Developer Verification and validation at unit test level
  • 8. Gaps and Cracks Bugs One common set of verifications that collaboratively making passed as the exit criteria or done-ness criteria
  • 9. Gaps and Cracks Contd..  The gap between unit tests : high-level software requirements, low-level technical details Behavior Requirement
  • 10. Executable Specification - User stories      Executable specifications 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
  • 11. What makes BDD different?    It technically Integrates the requirement to the SDLC. It demands developer to align the development with user requirement from the beginning. It is a engineering work bench that support requirement driven deveolopment.
  • 13. How do we implement this?  Process or workflow alignment  Technical solution
  • 14. The work-flow Feature > Scenarios Feature/Behavior Test Fixtures App implementation Acceptance
  • 15. BDD phases Elicitation – BA/Customer (Product) Elaboration – BA/QA (Product/QA) Implementation of feature - Dev Implementation of steps - QA Validation(Exploratory+BDT) Acceptance(Product owner-Demo)
  • 16. The framework anatomy Page Object layer (Pages and Elements) get_element1 Page One Page Two Page Three get_element 2 Basic Action Layer Composite action Layer (Helper abstract layer -Business flow layer) [Transferring browser control over page objects] action_element1 action_element2 Starting comp action Intermediate Comp Action Exiting comp Action Step Definition Layer (Collection of methods annotated in Cucumber/Gherkin - Given, When, Then, But or And) Junit executor class Feature Layer (Actual test cases represented as scenarios written in annotated names in step definition class.)
  • 17. The framework anatomy contd.. Page Object layer (Pages and Elements) Basic Action Layer Composite action Layer (Helper abstract layer -Business flow layer) Step Definition Layer (Collection of methods annotated in Cucumber/Gherkin - Given, When, Then, But or And) Feature Layer (Actual test cases represented as scenarios written in annotated names in step definition class.)
  • 18. TDD process and it’s roots Specify Behaviour Write little test Refactor Implement the App complying to the Behaviour Watch test fail Get test pass Wire steps with automation code
  • 20. The jargon     Feature : Piece of system functionality that delivers value. User story : Vertical functional slice of a feature that can be delivered independently Scenario : One key example for a feature in the feature file. This amounts to the main functional flows/ behaviors * critical data (derived through a test design technique) Step: Domain language phrases which can be combined to create scenarios.
  • 21. Cucumber    Cucumber is a testing framework that speaks the language of Gherkin. It wires the .feature or the executable spec to its corresponding test implementation the ―step definitions‖. Using Cucumber doesnt mean you are practicing BDD!
  • 22. Cucumber-JVM and the tech stack • Cucumber-JVM is a pure Java implementation of Cucumber, with native support for the most popular JVM languages: Java, Scala, Groovy, Clojure, Rhino, Jython and JRuby. • Selenium Web Driver : Java : Junit : Maven
  • 23. Gherkin in two mins  Gherkin is the language that Cucumber understands.  purposes — documentation and automated tests  it’s talking to you, telling you what code you should write.  Single Gherkin source file contains a description of a single feature.  Source files have .feature extension.
  • 24. Gherkin in two mins …..  Features,User Stories, Scenarios and steps  line-oriented language that uses indentation to define structure  Line endings terminate statements  Either spaces or tabs may be used for indentation  lines start with a keyword (Feature,Background,Scenario,Scenario Template,Given,When,Then,And,But)  Comment lines are allowed anywhere #  Regular expressions  Tables
  • 25. Gherkin in two mins ….. Keywords  Given : Pre condition  When: primary action of a scenario  Then : Post condition, expected observable outcomes.  And, But If you have several Given, When or Then steps.
  • 26. Data driven Scenario Outline: Login Success and Failure Given I navigate to the mock application When I try to login with '<type>' credentials Then I should see that I logged in '<status>' Examples: | type | valid | invalid | status | | successfully | | unsuccessfully|
  • 27. Setting up the IDE  Pre conditions:  IntelliJ IDEA 12 Community Edition In the IDE add the following plugins; Settings> IDE settings > Plugins > Install JetBrains Plugins > Gherkin V1.1 Settings> IDE settings > Plugins > Install JetBrains Plugins > Cucumber for Groovy V1.0 Settings> IDE settings > Plugins > Install JetBrains Plugins > Cucumber for Java V1.0
  • 28. IDE features  1. Code Completion (Step definition and Gherking syntax support)  2. Cucumber Framework Support  3. Drill down from *.feature file to step definition  4. Code Formatting  5. Junit runner support
  • 29. Framework Changes Step 1 – Adding Maven Dependencies  Simple five steps approach in the framework level changes  Assumptions  Existing Java/Junit/Maven/Web Driver based test framework.  Or Create an empty maven project  Apart from the junit/Selenium deps add the following deps to the maven pom file <dependency> <groupId>info.cukes</groupId> <artifactId>cucumber-java</artifactId> <version>1.1.4</version> <scope>test</scope> </dependency> <dependency> <groupId>info.cukes</groupId> <artifactId>cucumber-junit</artifactId> <version>1.1.5</version> <scope>test</scope> </dependency>
  • 30. Framework Changes Step 2 - Set up package structure
  • 31. Framework Changes Step 3: Add the junit runner class
  • 32. Framework Changes Step 4 - Add the step definition class
  • 33. Framework Changes Step 5 - Add the feature file
  • 34. The role of the CI dashboard  Create a view in the name of the sprint and add the junit runner class to separate new projects and let every one know where we are!
  • 35. Demo  Sprint X starts  Scenarios were written  Create CI project dashboard for Sprint X and initiate.  QA : Write the test fixture and implement any step definitions. Use mock elements(xpath or id etc.) refering to the wire frames and create the page objects. Replace them with the real element references as soon the details available.  Dev: Implement the Code  Tests getting passed progressively  Done: All tests are passed + Planned manual tests are executed.
  • 36. Auto generated code skeleton @Given("^add (d+) and (d+)$") public void add_and(int arg1, int arg2) throws Throwable { // Express the Regexp above with the code you wish you had throw new PendingException(); }
  • 37. The transition    In the original proposal the transition would be just using ―should‖ instead of ―test‖ in the unit testing! User story: "As a [role] I want [feature] so that [benefit]". Scenario: ―Given [initial context], when [event occurs], then [ensure some outcomes]‖  Test method names should be sentences  A simple sentence template keeps test methods focused  An expressive test name is helpful when a test fails  ―Behavior‖ is a more useful word than ―test‖  Requirements are behavior,too  Acceptance criteria should be executable
  • 38. Agile Scrum Alignment  Feature : Backlog item  Scenario: Test case  Donness : Built in - Green report + Manual expert/exploratory testing sign off.  Continuous collaboration : BDD enforces it.  Continuous integration : BDD enforces it. (Part of the build.)  Recommends automation : BDD enforces it.  Just enough/living documentation that serve multiple purposes.  Always know how much is remaining.
  • 39. Manual testing?  Expertize driven testing  Exploratory testing  Regression ?  Limitations of automation ?
  • 40. Can we only do BDT without BDD  Yes and a No!  BDT can be identified as the means of realizing BDD.
  • 41. Some more advantages  Non technical  BA's Product owners, OPS, Dev, QA speaking the same language  Defines Doneness criteria  Automated Regression Test suites.  No compilation issues only runtime.  User expected behavior conformance is maintained from the beginning...
  • 42. Advantages Contd…  Tests can become truly useful documentation  Helps you to separate "what?" from "how?"  Purposely small command-set is simple to learn  Separating requirements from implementation helps refactoring  Specifications can be as thorough as unit tests  Specifications can be hooked in at different levels  Agreeing details up-front allows finer control over scope  Test coverage no longer relies on developer self-discipline  automatic generation of technical and end user documentation from BDD "specifications"
  • 43. The collaboration • In BDD a significant portion of "functional documentation" defined in the form of ―User Stories‖. • "tests", a BDD practitioner will prefer the terms "scenario" and "specification". • "functional tests", the preferred term will be "specifications of the product's behavior". • "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"
  • 44. You are already a BDD practitioner  If you are practicing TDD properly  BDD, often described as ―TDD done well‖  User focused TDD
  • 45. TOOLS  JSpec - JavaScript Behavior Driven Development  SpecFlow - Pragmatic BDD for .NET • • • • • • • • FitNesse Cucumber (software) Framework for Integrated Test JBehave Robot Framework Concordion specs2 specflow
  • 46. BDT is a paradigm shift for QA • Reclaiming the QA role within the Agile world • No tests but scenarios! • Technical convergence • Early/Parallel automation. • Just enough Engineering practices! • Tests frameworks without layers ! Record and play ! • Highly engaged requirement deal • Its not about the tools but about the practices !
  • 47. Future implementations  API Testing (In conjunction with Rest Assured)  Performance testing (In conjunction with Jmeter)  Consolidated online CASE tool? A communication and collaboration framework for developers, QA and nontechnical or business participants in a software project.
  • 48. More • http://aslakhellesoy.com/post/20006051268/cucumber-jvm-1-0-0 • http://www.ibm.com/developerworks/opensource/library/a-automatingria/index.html • RSpec, Cucumber and GivWenZen(Fitness) • FitNess • http://fitnesse.org/ • Xebium : Combine the power of Selenium • http://xebia.github.io/Xebium/ • BDD original proposal • http://dannorth.net/introducing-bdd/
  • 49. Q&A