SlideShare a Scribd company logo
www.unicomlearning.com

India Agile Week-2013
26-Oct-2013 at Pune

BDD in an Agile world
Gaurav Awasthi
Senior Architect and Technology Evangelist

www.agileinbusiness.com
Concept, Practice, Tools

www.unicomlearning.com

Concept, Practice and finally Tools
Concepts are beyond Practices and Tools
Good Tools are better suited to Practices which
help internalize Concepts quickly

UNICOM Presents

India Agile Week-2013
The BDD World…
 Concepts
 Write software that matters
 In close collaboration with Stakeholder

 Practices
 Writing features, scenarios
 Write executable specs

 Tools
 Cucumber
 JBehave
 RSpecs
UNICOM Presents

India Agile Week-2013

www.unicomlearning.com
BDD…by definition

www.unicomlearning.com

BDD is a second-generation,
outside-in,
multiple-stakeholder,
high-automation,
agile methodology.
It describes a cycle of interactions with well-defined
outputs, resulting in the delivery of working, tested software
that matters.
Dan North
UNICOM Presents

India Agile Week-2013
Buzzword Agnostic Benefits…

www.unicomlearning.com

• Seamless mapping between Requirement statements and
executable tests

• Specification by example
• Loose grammar of the domain
• Brings Testers/QA to the forefront of development
process
• Self verifying documentation

• Evolves behavior as the domain understanding changes
UNICOM Presents

India Agile Week-2013
Co-existence with TDD
Write a failing
feature test

BDD

www.unicomlearning.com

Write a
failing unit
test
TDD

Refactor
TDD – Develop it the
right way
BDD – Develop the right
thing
UNICOM Presents

India Agile Week-2013

Make the
test pass
And what about DDD ?
• Domain Driven Design
• Ubiquitous Language
• gives vocabulary
• Inside Out

• Behavior Driven Development
• Sentences out of the vocabulary
• Description of the behavior
• Outside In

UNICOM Presents

India Agile Week-2013

www.unicomlearning.com
The BDD Practice

www.unicomlearning.com

1. Describe the behavior in plain text – Features and Scenarios
2. Write a step definition for each Step
3. Run it and watch it fail
4. Write code to make the step pass
5. Run it again and see the step pass
6. Repeat step 2 – 5 until green like a Cuke
7. Repeat step 1 – 6 until the money runs out

UNICOM Presents

India Agile Week-2013
The Tool - Cucumber
Why Cucumber ?
• one of the least technical tools
• a very active open source project
• supports a variety of languages

UNICOM Presents

India Agile Week-2013

www.unicomlearning.com
Slicing Cucumber

www.unicomlearning.com

•

JBehave -> ported to Ruby -> RBehave -> rewritten from scratch > RSpec -> + story runner -> Cucumber -> Cucumber-JVM

•

Aslak Hellesoy ported Cucumber to Java (cucumber-jvm)

•

Cucumber comes with Ruby (the original), Java, .NET, Adobe Flex,
Python, Perl, Erlang, PHP

•

Full stack for acceptance tests include – Browser Driver and
Browser

UNICOM Presents

India Agile Week-2013
Gherkin

www.unicomlearning.com

• A Business Readable, Domain Specific Language that
Cucumber understands
• Line-based language that Cucumber uses to define
behaviors in the form of features, scenarios, and steps

• Serves 3 purposes :
•
•
•

Automated Tests
Documentation
Specs for Code to be written

• Source files have .feature extension. Single Gherkin source
file contains a description of a single feature
UNICOM Presents

India Agile Week-2013
Gherkin syntax
Feature : title

www.unicomlearning.com

 As a [ person or role who will benefit ]
 I want [ some feature ]
 So that [ benefit or value of the feature ]
UNICOM Presents

India Agile Week-2013
Gherkin syntax
Scenario : title
 Given [ some initial context ]
 When [ an event occurs]
 Then [ ensures some outcome ]
UNICOM Presents

India Agile Week-2013

www.unicomlearning.com
Example
Feature: Customer
purchases a device
• As a Customer
• I want to purchase a Bluetooth
device
• So that I can make or receive a
hands free call

www.unicomlearning.com

Scenario : Customer has a
credit note valued more
than the receipt amount
• Given the customer is on the till

• And he has a credit note of Rs
1000
• And the receipt amount is Rs 500
• When the balance amount is
paid
• Then the billing completes

UNICOM Presents

India Agile Week-2013
Cucumber Options
@RunWith(Cucumber.class)
@Cucumber.Options (
tags = “@focus”,
features= “classpath:billing.feature”
)
public class CukeRunner {
}
Some common options :
• features – path to the feature files
• glue – where to look for step definition and hooks
• tags – what tags in the features should be executed
• format – what formatters to use
• …
UNICOM Presents

India Agile Week-2013

www.unicomlearning.com
CLI Option

www.unicomlearning.com

• Several Runners
•
•
•

Command Line Interface
JUnit Runner
Android Runner

cucumber-core
cucumber-junit
cucumber-android

• java cucumber.cli.Main [options] [FILE|DIR]
•

--glue , --format, --tags, --name …

• Benefit :
•
•

Independent of JUnit
Integration with Ant

UNICOM Presents

India Agile Week-2013
Demo Code
•

Create a maven project, with cucumber-jvm related
dependencies
•

•

Feature: Withdrawing money from a User account
•
Scenario: Withdrawing money from a User's account should
reduce money in the current balance
•
Given a User has $100 in his account
•
When $50 is withdrawn from the account
•
Then the balance should be $50

Write Java wrapper class – like CukeRunner,
•

•
•
•

cucumber-core, cucumber-java, cucumber-junit

Write a Feature and a scenario with steps
•

•

www.unicomlearning.com

annotated with RunWith and Cucumber.Options

Run the class, let it fail
Implement Steps, Run again
See it green like a cuke

UNICOM Presents

India Agile Week-2013
And the debate

www.unicomlearning.com

To TDD, To BDD
or
To prefer one over the other

UNICOM Presents

India Agile Week-2013
References
•
•
•
•
•

www.unicomlearning.com

That's not BDD, that's just Cucumber by Chris Parsons
Introducing BDD by Dan North
http://dannorth.net/whats-in-a-story/ by Dan North
http://cukes.info/install-cucumber-jvm.html
http://cukes.info/api/cucumber/jvm/javadoc/cucumber/api/junit/C
ucumber.Options.html

UNICOM Presents

India Agile Week-2013
www.unicomlearning.com

Speaker name: Gaurav Awasthi
Email ID: gawasthi22@gmail.com

India Agile Week-2013
Organized by
UNICOM Trainings & Seminars Pvt. Ltd.
contact@unicomlearning.com

More Related Content

Similar to Behaviour Driven Development - Cuking the Agile world

How to Integrate UX and Agile
How to Integrate UX and AgileHow to Integrate UX and Agile
How to Integrate UX and AgileUserZoom
 
Evolution and History of Angular as Web Development Platform.pdf
Evolution and History of Angular as Web Development Platform.pdfEvolution and History of Angular as Web Development Platform.pdf
Evolution and History of Angular as Web Development Platform.pdf
iFour Technolab Pvt. Ltd.
 
Accessibility Testing - Using Asqatasun - Meetup Webinar
Accessibility Testing - Using Asqatasun - Meetup WebinarAccessibility Testing - Using Asqatasun - Meetup Webinar
Accessibility Testing - Using Asqatasun - Meetup Webinar
Keyur Shah
 
Angular Meetup 1 - Angular Basics and Workshop
Angular Meetup 1 - Angular Basics and WorkshopAngular Meetup 1 - Angular Basics and Workshop
Angular Meetup 1 - Angular Basics and Workshop
Nitin Bhojwani
 
A Comprehensive Guide to Conducting Test Automation Using Appium & Cucumber o...
A Comprehensive Guide to Conducting Test Automation Using Appium & Cucumber o...A Comprehensive Guide to Conducting Test Automation Using Appium & Cucumber o...
A Comprehensive Guide to Conducting Test Automation Using Appium & Cucumber o...
flufftailshop
 
India agile week chennai - Agile maturity to scale for enterprise & blendin...
India agile week   chennai - Agile maturity to scale for enterprise & blendin...India agile week   chennai - Agile maturity to scale for enterprise & blendin...
India agile week chennai - Agile maturity to scale for enterprise & blendin...
Venkat Janardhanam, MS, MBA
 
5 Best Automation Testing Tools to Speed up Testing.pdf
5 Best Automation Testing Tools to Speed up Testing.pdf5 Best Automation Testing Tools to Speed up Testing.pdf
5 Best Automation Testing Tools to Speed up Testing.pdf
Serena Gray
 
Canada DevOps Summit 2020 Presentation Nov_03_2020
Canada DevOps Summit 2020 Presentation Nov_03_2020Canada DevOps Summit 2020 Presentation Nov_03_2020
Canada DevOps Summit 2020 Presentation Nov_03_2020
Varun Manik
 
Unicom DevCon - CI/CD for Asp.net core apps using Docker
Unicom DevCon - CI/CD for Asp.net core apps using DockerUnicom DevCon - CI/CD for Asp.net core apps using Docker
Unicom DevCon - CI/CD for Asp.net core apps using Docker
Swaminathan Vetri
 
Continuous delivery @ iyzico
Continuous delivery @ iyzicoContinuous delivery @ iyzico
Continuous delivery @ iyzico
Ümit Ünal
 
Browserscope oscon 2011
Browserscope oscon 2011Browserscope oscon 2011
Browserscope oscon 2011lsimon
 
Managed Beans: When, Why and How
Managed Beans: When, Why and HowManaged Beans: When, Why and How
Managed Beans: When, Why and How
Russell Maher
 
How Oracle Integrates Accessibility into the Development Process
How Oracle Integrates Accessibility into the Development ProcessHow Oracle Integrates Accessibility into the Development Process
How Oracle Integrates Accessibility into the Development Process
3Play Media
 
Optimus XPages: An Explosion of Techniques and Best Practices
Optimus XPages: An Explosion of Techniques and Best PracticesOptimus XPages: An Explosion of Techniques and Best Practices
Optimus XPages: An Explosion of Techniques and Best Practices
Teamstudio
 
IncQuery Server for Teamwork Cloud - Talk at IW2019
IncQuery Server for Teamwork Cloud - Talk at IW2019IncQuery Server for Teamwork Cloud - Talk at IW2019
IncQuery Server for Teamwork Cloud - Talk at IW2019
Istvan Rath
 
Amazon CodeGuru - Automate Code review and Code performance monitoring
Amazon CodeGuru - Automate Code review and Code performance monitoringAmazon CodeGuru - Automate Code review and Code performance monitoring
Amazon CodeGuru - Automate Code review and Code performance monitoring
Olawale Olaleye
 
Coded Automation and Autopilot.pptx
Coded Automation and Autopilot.pptxCoded Automation and Autopilot.pptx
Coded Automation and Autopilot.pptx
ZellAlfeche
 
Introduction to Protractor
Introduction to ProtractorIntroduction to Protractor
Introduction to Protractor
Florian Fesseler
 

Similar to Behaviour Driven Development - Cuking the Agile world (20)

How to Integrate UX and Agile
How to Integrate UX and AgileHow to Integrate UX and Agile
How to Integrate UX and Agile
 
Evolution and History of Angular as Web Development Platform.pdf
Evolution and History of Angular as Web Development Platform.pdfEvolution and History of Angular as Web Development Platform.pdf
Evolution and History of Angular as Web Development Platform.pdf
 
Accessibility Testing - Using Asqatasun - Meetup Webinar
Accessibility Testing - Using Asqatasun - Meetup WebinarAccessibility Testing - Using Asqatasun - Meetup Webinar
Accessibility Testing - Using Asqatasun - Meetup Webinar
 
Angular Meetup 1 - Angular Basics and Workshop
Angular Meetup 1 - Angular Basics and WorkshopAngular Meetup 1 - Angular Basics and Workshop
Angular Meetup 1 - Angular Basics and Workshop
 
A Comprehensive Guide to Conducting Test Automation Using Appium & Cucumber o...
A Comprehensive Guide to Conducting Test Automation Using Appium & Cucumber o...A Comprehensive Guide to Conducting Test Automation Using Appium & Cucumber o...
A Comprehensive Guide to Conducting Test Automation Using Appium & Cucumber o...
 
India agile week chennai - Agile maturity to scale for enterprise & blendin...
India agile week   chennai - Agile maturity to scale for enterprise & blendin...India agile week   chennai - Agile maturity to scale for enterprise & blendin...
India agile week chennai - Agile maturity to scale for enterprise & blendin...
 
5 Best Automation Testing Tools to Speed up Testing.pdf
5 Best Automation Testing Tools to Speed up Testing.pdf5 Best Automation Testing Tools to Speed up Testing.pdf
5 Best Automation Testing Tools to Speed up Testing.pdf
 
Canada DevOps Summit 2020 Presentation Nov_03_2020
Canada DevOps Summit 2020 Presentation Nov_03_2020Canada DevOps Summit 2020 Presentation Nov_03_2020
Canada DevOps Summit 2020 Presentation Nov_03_2020
 
Unicom DevCon - CI/CD for Asp.net core apps using Docker
Unicom DevCon - CI/CD for Asp.net core apps using DockerUnicom DevCon - CI/CD for Asp.net core apps using Docker
Unicom DevCon - CI/CD for Asp.net core apps using Docker
 
Continuous delivery @ iyzico
Continuous delivery @ iyzicoContinuous delivery @ iyzico
Continuous delivery @ iyzico
 
Cucumber_Training_ForQA
Cucumber_Training_ForQACucumber_Training_ForQA
Cucumber_Training_ForQA
 
Browserscope oscon 2011
Browserscope oscon 2011Browserscope oscon 2011
Browserscope oscon 2011
 
Managed Beans: When, Why and How
Managed Beans: When, Why and HowManaged Beans: When, Why and How
Managed Beans: When, Why and How
 
How Oracle Integrates Accessibility into the Development Process
How Oracle Integrates Accessibility into the Development ProcessHow Oracle Integrates Accessibility into the Development Process
How Oracle Integrates Accessibility into the Development Process
 
Optimus XPages: An Explosion of Techniques and Best Practices
Optimus XPages: An Explosion of Techniques and Best PracticesOptimus XPages: An Explosion of Techniques and Best Practices
Optimus XPages: An Explosion of Techniques and Best Practices
 
IncQuery Server for Teamwork Cloud - Talk at IW2019
IncQuery Server for Teamwork Cloud - Talk at IW2019IncQuery Server for Teamwork Cloud - Talk at IW2019
IncQuery Server for Teamwork Cloud - Talk at IW2019
 
Amazon CodeGuru - Automate Code review and Code performance monitoring
Amazon CodeGuru - Automate Code review and Code performance monitoringAmazon CodeGuru - Automate Code review and Code performance monitoring
Amazon CodeGuru - Automate Code review and Code performance monitoring
 
Journey to the center of DevOps - v6
Journey to the center of DevOps - v6Journey to the center of DevOps - v6
Journey to the center of DevOps - v6
 
Coded Automation and Autopilot.pptx
Coded Automation and Autopilot.pptxCoded Automation and Autopilot.pptx
Coded Automation and Autopilot.pptx
 
Introduction to Protractor
Introduction to ProtractorIntroduction to Protractor
Introduction to Protractor
 

Recently uploaded

Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
DianaGray10
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofszkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
Alex Pruden
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
Neo4j
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
DianaGray10
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
sonjaschweigert1
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Nexer Digital
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
Neo4j
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
Pierluigi Pugliese
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
Neo4j
 

Recently uploaded (20)

Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofszkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
 

Behaviour Driven Development - Cuking the Agile world

  • 1. www.unicomlearning.com India Agile Week-2013 26-Oct-2013 at Pune BDD in an Agile world Gaurav Awasthi Senior Architect and Technology Evangelist www.agileinbusiness.com
  • 2. Concept, Practice, Tools www.unicomlearning.com Concept, Practice and finally Tools Concepts are beyond Practices and Tools Good Tools are better suited to Practices which help internalize Concepts quickly UNICOM Presents India Agile Week-2013
  • 3. The BDD World…  Concepts  Write software that matters  In close collaboration with Stakeholder  Practices  Writing features, scenarios  Write executable specs  Tools  Cucumber  JBehave  RSpecs UNICOM Presents India Agile Week-2013 www.unicomlearning.com
  • 4. BDD…by definition www.unicomlearning.com BDD is a second-generation, outside-in, multiple-stakeholder, high-automation, agile methodology. It describes a cycle of interactions with well-defined outputs, resulting in the delivery of working, tested software that matters. Dan North UNICOM Presents India Agile Week-2013
  • 5. Buzzword Agnostic Benefits… www.unicomlearning.com • Seamless mapping between Requirement statements and executable tests • Specification by example • Loose grammar of the domain • Brings Testers/QA to the forefront of development process • Self verifying documentation • Evolves behavior as the domain understanding changes UNICOM Presents India Agile Week-2013
  • 6. Co-existence with TDD Write a failing feature test BDD www.unicomlearning.com Write a failing unit test TDD Refactor TDD – Develop it the right way BDD – Develop the right thing UNICOM Presents India Agile Week-2013 Make the test pass
  • 7. And what about DDD ? • Domain Driven Design • Ubiquitous Language • gives vocabulary • Inside Out • Behavior Driven Development • Sentences out of the vocabulary • Description of the behavior • Outside In UNICOM Presents India Agile Week-2013 www.unicomlearning.com
  • 8. The BDD Practice www.unicomlearning.com 1. Describe the behavior in plain text – Features and Scenarios 2. Write a step definition for each Step 3. Run it and watch it fail 4. Write code to make the step pass 5. Run it again and see the step pass 6. Repeat step 2 – 5 until green like a Cuke 7. Repeat step 1 – 6 until the money runs out UNICOM Presents India Agile Week-2013
  • 9. The Tool - Cucumber Why Cucumber ? • one of the least technical tools • a very active open source project • supports a variety of languages UNICOM Presents India Agile Week-2013 www.unicomlearning.com
  • 10. Slicing Cucumber www.unicomlearning.com • JBehave -> ported to Ruby -> RBehave -> rewritten from scratch > RSpec -> + story runner -> Cucumber -> Cucumber-JVM • Aslak Hellesoy ported Cucumber to Java (cucumber-jvm) • Cucumber comes with Ruby (the original), Java, .NET, Adobe Flex, Python, Perl, Erlang, PHP • Full stack for acceptance tests include – Browser Driver and Browser UNICOM Presents India Agile Week-2013
  • 11. Gherkin www.unicomlearning.com • A Business Readable, Domain Specific Language that Cucumber understands • Line-based language that Cucumber uses to define behaviors in the form of features, scenarios, and steps • Serves 3 purposes : • • • Automated Tests Documentation Specs for Code to be written • Source files have .feature extension. Single Gherkin source file contains a description of a single feature UNICOM Presents India Agile Week-2013
  • 12. Gherkin syntax Feature : title www.unicomlearning.com  As a [ person or role who will benefit ]  I want [ some feature ]  So that [ benefit or value of the feature ] UNICOM Presents India Agile Week-2013
  • 13. Gherkin syntax Scenario : title  Given [ some initial context ]  When [ an event occurs]  Then [ ensures some outcome ] UNICOM Presents India Agile Week-2013 www.unicomlearning.com
  • 14. Example Feature: Customer purchases a device • As a Customer • I want to purchase a Bluetooth device • So that I can make or receive a hands free call www.unicomlearning.com Scenario : Customer has a credit note valued more than the receipt amount • Given the customer is on the till • And he has a credit note of Rs 1000 • And the receipt amount is Rs 500 • When the balance amount is paid • Then the billing completes UNICOM Presents India Agile Week-2013
  • 15. Cucumber Options @RunWith(Cucumber.class) @Cucumber.Options ( tags = “@focus”, features= “classpath:billing.feature” ) public class CukeRunner { } Some common options : • features – path to the feature files • glue – where to look for step definition and hooks • tags – what tags in the features should be executed • format – what formatters to use • … UNICOM Presents India Agile Week-2013 www.unicomlearning.com
  • 16. CLI Option www.unicomlearning.com • Several Runners • • • Command Line Interface JUnit Runner Android Runner cucumber-core cucumber-junit cucumber-android • java cucumber.cli.Main [options] [FILE|DIR] • --glue , --format, --tags, --name … • Benefit : • • Independent of JUnit Integration with Ant UNICOM Presents India Agile Week-2013
  • 17. Demo Code • Create a maven project, with cucumber-jvm related dependencies • • Feature: Withdrawing money from a User account • Scenario: Withdrawing money from a User's account should reduce money in the current balance • Given a User has $100 in his account • When $50 is withdrawn from the account • Then the balance should be $50 Write Java wrapper class – like CukeRunner, • • • • cucumber-core, cucumber-java, cucumber-junit Write a Feature and a scenario with steps • • www.unicomlearning.com annotated with RunWith and Cucumber.Options Run the class, let it fail Implement Steps, Run again See it green like a cuke UNICOM Presents India Agile Week-2013
  • 18. And the debate www.unicomlearning.com To TDD, To BDD or To prefer one over the other UNICOM Presents India Agile Week-2013
  • 19. References • • • • • www.unicomlearning.com That's not BDD, that's just Cucumber by Chris Parsons Introducing BDD by Dan North http://dannorth.net/whats-in-a-story/ by Dan North http://cukes.info/install-cucumber-jvm.html http://cukes.info/api/cucumber/jvm/javadoc/cucumber/api/junit/C ucumber.Options.html UNICOM Presents India Agile Week-2013
  • 20. www.unicomlearning.com Speaker name: Gaurav Awasthi Email ID: gawasthi22@gmail.com India Agile Week-2013 Organized by UNICOM Trainings & Seminars Pvt. Ltd. contact@unicomlearning.com

Editor's Notes

  1. What TDD does, its explanation, what it doesn’t do, and how BDD fits in
  2. Why Cucumber – least technical, very active open source project, supports variety of language