SlideShare a Scribd company logo
Executable Requirements
     with BDD and




   http://cukes.info/

  Aslak Hellesøy - Chief Scientist


         @aslak_hellesoy
    aslak.hellesoy@gmail.com
BDD: Dual audience




Stakeholders      Testers
    Users      Programmers
UBIQUITOUS
Outside in
User Story
User Story
Sign up
In order to avoid manual work
participants should be able to
sign up on the web
User Story
Sign up
In order to avoid manual work
participants should be able to
sign up on the web
User Story
Sign up
In order to avoid manual work
participants should be able to
sign up on the web
User Story
Sign up
In order to avoid manual work
participants should be able to
sign up on the web
Common understanding

   of   Done
Acceptance
Acceptance
Given I am on the signup page
And I have filled in the form
When I click “sign up”
Then I should get email confirm.

Given...
When...
Then...
Acceptance
              They are examples!

Given I am on the signup page
And I have filled in the form
When I click “sign up”
Then I should get email confirm.

Given...
When...
Then...
Acceptance
http://cukes.info/
http://www.flickr.com/photos/twose/887903401/
http://www.flickr.com/photos/twose/887903401/
80000 downloads




  http://www.flickr.com/photos/twose/887903401/
80000 downloads
 1550 followers




  http://www.flickr.com/photos/twose/887903401/
80000 downloads
 1550 followers
180 contributors



   http://www.flickr.com/photos/twose/887903401/
80000 downloads
 1550 followers
180 contributors
  65 wiki pages


   http://www.flickr.com/photos/twose/887903401/
80000 downloads
 1550 followers
180 contributors
  65 wiki pages
    40 tools

   http://www.flickr.com/photos/twose/887903401/
80000 downloads
 1550 followers
180 contributors
  65 wiki pages
    40 tools
 20 screencasts

   http://www.flickr.com/photos/twose/887903401/
80000 downloads
 1550 followers
180 contributors
  65 wiki pages
    40 tools
 20 screencasts
60 in #cucumber
   http://www.flickr.com/photos/twose/887903401/
80000 downloads
 1550 followers
180 contributors
  65 wiki pages
    40 tools
 20 screencasts
60 in #cucumber
  #7 on Github
   http://www.flickr.com/photos/twose/887903401/
Executable Requirements with Behaviour-Driven Development and Cucumber - EuroSTAR 2009
Javascript




Next:
Cuke4Duke
Gherkin
(language)
# language: en
Feature: Division
  In order to avoid silly mistakes
  Cashiers must be able to calculate a fraction

  Scenario: Regular numbers
    Given I have entered 3 into the calculator
    And I have entered 2 into the calculator
    When I press divide
    Then the result should be 1.5 on the screen
# language: ja
        :




        :
        3
        2
        divide
            1.5
OH HAI: STUFFING
  MISHUN: CUCUMBR
    I CAN HAZ IN TEH BEGINNIN "3" CUCUMBRZ
    WEN I EAT "2" CUCUMBRZ
    DEN I HAZ "2" CUCUMBERZ IN MAH BELLY
    AN IN TEH END "1" CUCUMBRZ KTHXBAI!
# language: no
Egenskap: Summering
  For å slippe å gjøre dumme feil
  Som en regnskapsfører
  Vil jeg kunne legge sammen

  Scenario: to tall
    Gitt at jeg har tastet inn 5
    Og at jeg har tastet inn 7
    Når jeg summerer
    Så skal resultatet være 12
magyar
български                     Bahasa Indonesia
   català                         italiano
 Cymraeg     lietuvių kalba       русский
   Česky         latviešu         Svenska
   dansk       Nederlands        Slovensky
 Deutsch          norsk           Узбекча
  English         polski         Tiếng Việt
Australian     português
 LOLCAT          română
  Texan           suomi
 español         français          ‫עברית‬
eesti keel      hrvatski           ‫ﺍﻟﻌﺮﺑﻴﺔ‬
features
  division.feature
$ cucumber features/division.feature

# language: en
Feature: Division
  In order to avoid silly mistakes
  Cashiers must be able to calculate a fraction

 Scenario: Regular numbers                        #   features/division.feature:6
   Given I have entered 3 into the calculator     #   features/division.feature:7
   And I have entered 2 into the calculator       #   features/division.feature:8
   When I press divide                            #   features/division.feature:9
   Then the result should be 1.5 on the screen    #   features/division.feature:10

1 scenario (1 undefined)
4 steps (4 undefined)
0m0.005s
You can implement step definitions for undefined steps with these snippets:

Given /^I have entered 3 into the calculator$/ do
  pending
end

Given /^I have entered 2 into the calculator$/ do
  pending
end

When /^I press divide$/ do
  pending
end

Then /^the result should be 1.5 on the screen$/ do
  pending
end

If you want snippets in a different programming language, just make sure a file
with the appropriate file extension exists where cucumber looks for step
definitions.
features
  division.feature
  step_definitions
     calculator_steps.rb
Given /I have entered (d+) into the calculator/ do |n|
  @calc.push n.to_i
end

When /I press (w+)/ do |op|
  @result = @calc.send op
end

Then /the result should be (.*) on the screen/ do |result|
  @result.should == result.to_f
end
features
   division.feature
   step_definitions
      calculator_steps.rb
lib
   calculator.rb
$ cucumber features/division.feature

# language: en
Feature: Division
  In order to avoid silly mistakes
  Cashiers must be able to calculate a fraction

  Scenario: Regular numbers                       #   features/division.feature:6
    Given I have entered 3 into the calculator    #   features/step_definitons/calculator_steps.rb:14
    And I have entered 2 into the calculator      #   features/step_definitons/calculator_steps.rb:14
    When I press divide                           #   features/step_definitons/calculator_steps.rb:18
    Then the result should be 1.5 on the screen   #   features/step_definitons/calculator_steps.rb:22

1 scenario (1 passed)
4 steps (4 passed)
0m0.005s
Steps & Step

Given the secret code is "r g y c"


@Given("^the secret code is "([^"]*)"$")
public void theSecretCodeIs(String code) {
    game = new Game(code);
}
Scenario Outline
Scenario Outline: submit guess
  Given the secret code is "<code>"
  When I guess "<guess>"
  Then the mark should be "<mark>"

Examples:
  | code        |   guess       |   mark   |
  | r g y   c   |   r g y   c   |   bbbb   |
  | r g y   c   |   r g c   y   |   bbww   |
  | r g y   c   |   y r g   c   |   bwww   |
  | r g y   c   |   c r g   y   |   wwww   |
Multiline args (String)
Then aslak.hellesoy@gmail.com should get email
  """
  Hi aslak.hellesoy@gmail.com
  Congratulations, Cucumberer was accepted.
  See you at JavaZone!
  """


@Then("^(.*) should get email$")
public void email(String email, String body) {
}
Multiline args (Tables)
Given the following proposals
  | email                     | title   |
  | aslak.hellesoy@gmail.com | Cucumber |
  | bryan@brynary.com         | Webrat  |



@Given("^the following proposals$")
public void proposals(cuke4duke.Table proposals) {
}
Background
Feature: Notification emails
  Background:
    Given the following proposals exist
      | email                    | title    |
      | aslak.hellesoy@gmail.com | Cucumber |
      | bryan@brynary.com        | Webrat   |

Scenario: Approve all

Scenario: Reject Webrat
Tags

Feature: Take over the world
  I want it all

 @spanish @french @english
 Scenario: Take over Europe

 @spanish @english
 Scenario: Take over America

 @english
 Scenario: Take over Australia
Tags
cucumber -t spanish doit.feature

Feature: Take over the world
  I want it all

  @spanish @french @english
  Scenario: Take over Europe

  @spanish @english
  Scenario: Take over America

  @english
  Scenario: Take over Australia
Tags

Feature: Take over the world
  I want it all

 @spanish @french @english
 Scenario: Take over Europe

 @spanish @english
 Scenario: Take over America

 @english
 Scenario: Take over Australia
Tags
cucumber -t ~french doit.feature

Feature: Take over the world
  I want it all

  @spanish @french @english
  Scenario: Take over Europe

  @spanish @english
  Scenario: Take over America

  @english
  Scenario: Take over Australia
Formatters


   Pretty
 Progress
  Profile
   HTML
   JUnit
   Rerun
 Your Own
http://cukes.info/
 @aslak_hellesoy
    #cucumber
Ad

More Related Content

What's hot (7)

A Universal Automation Framework based on BDD Cucumber and Ruby on Rails - Ph...
A Universal Automation Framework based on BDD Cucumber and Ruby on Rails - Ph...A Universal Automation Framework based on BDD Cucumber and Ruby on Rails - Ph...
A Universal Automation Framework based on BDD Cucumber and Ruby on Rails - Ph...
Ho Chi Minh City Software Testing Club
 
Scalar::Footnote
Scalar::FootnoteScalar::Footnote
Scalar::Footnote
Steve Purkis
 
Web Scraping
Web ScrapingWeb Scraping
Web Scraping
jameswilkerson
 
Programming For Designers V3
Programming For Designers V3Programming For Designers V3
Programming For Designers V3
sqoo
 
Outside-in Development with Cucumber and Rspec
Outside-in Development with Cucumber and RspecOutside-in Development with Cucumber and Rspec
Outside-in Development with Cucumber and Rspec
Joseph Wilk
 
role=drinks AMS Meetup: 5 Pro Tips for Making Your Email More Accessible
role=drinks AMS Meetup: 5 Pro Tips for Making Your Email More Accessiblerole=drinks AMS Meetup: 5 Pro Tips for Making Your Email More Accessible
role=drinks AMS Meetup: 5 Pro Tips for Making Your Email More Accessible
eROI
 
Copycopter Presentation by Joe Ferris at BostonRB
Copycopter Presentation by Joe Ferris at BostonRBCopycopter Presentation by Joe Ferris at BostonRB
Copycopter Presentation by Joe Ferris at BostonRB
bostonrb
 
A Universal Automation Framework based on BDD Cucumber and Ruby on Rails - Ph...
A Universal Automation Framework based on BDD Cucumber and Ruby on Rails - Ph...A Universal Automation Framework based on BDD Cucumber and Ruby on Rails - Ph...
A Universal Automation Framework based on BDD Cucumber and Ruby on Rails - Ph...
Ho Chi Minh City Software Testing Club
 
Programming For Designers V3
Programming For Designers V3Programming For Designers V3
Programming For Designers V3
sqoo
 
Outside-in Development with Cucumber and Rspec
Outside-in Development with Cucumber and RspecOutside-in Development with Cucumber and Rspec
Outside-in Development with Cucumber and Rspec
Joseph Wilk
 
role=drinks AMS Meetup: 5 Pro Tips for Making Your Email More Accessible
role=drinks AMS Meetup: 5 Pro Tips for Making Your Email More Accessiblerole=drinks AMS Meetup: 5 Pro Tips for Making Your Email More Accessible
role=drinks AMS Meetup: 5 Pro Tips for Making Your Email More Accessible
eROI
 
Copycopter Presentation by Joe Ferris at BostonRB
Copycopter Presentation by Joe Ferris at BostonRBCopycopter Presentation by Joe Ferris at BostonRB
Copycopter Presentation by Joe Ferris at BostonRB
bostonrb
 

Viewers also liked (7)

Effective Testing using Behavior-Driven Development
Effective Testing using Behavior-Driven DevelopmentEffective Testing using Behavior-Driven Development
Effective Testing using Behavior-Driven Development
Alexander Kress
 
Strategies for Payment Systems Planning
Strategies for Payment Systems PlanningStrategies for Payment Systems Planning
Strategies for Payment Systems Planning
Gary Farrow
 
TDD of HTTP Clients With WebMock
TDD of HTTP Clients With WebMockTDD of HTTP Clients With WebMock
TDD of HTTP Clients With WebMock
Bartosz Blimke
 
Open Group Conference 2011 - The Canonical Data Zone
Open Group Conference 2011 - The Canonical Data ZoneOpen Group Conference 2011 - The Canonical Data Zone
Open Group Conference 2011 - The Canonical Data Zone
Gary Farrow
 
IET NW Region - Payment Hub Design
IET NW Region - Payment Hub DesignIET NW Region - Payment Hub Design
IET NW Region - Payment Hub Design
Gary Farrow
 
Cucumber & gherkin language
Cucumber & gherkin languageCucumber & gherkin language
Cucumber & gherkin language
selvanathankapilan
 
The Payments Hub Spectrum
The Payments Hub SpectrumThe Payments Hub Spectrum
The Payments Hub Spectrum
Gary Farrow
 
Effective Testing using Behavior-Driven Development
Effective Testing using Behavior-Driven DevelopmentEffective Testing using Behavior-Driven Development
Effective Testing using Behavior-Driven Development
Alexander Kress
 
Strategies for Payment Systems Planning
Strategies for Payment Systems PlanningStrategies for Payment Systems Planning
Strategies for Payment Systems Planning
Gary Farrow
 
TDD of HTTP Clients With WebMock
TDD of HTTP Clients With WebMockTDD of HTTP Clients With WebMock
TDD of HTTP Clients With WebMock
Bartosz Blimke
 
Open Group Conference 2011 - The Canonical Data Zone
Open Group Conference 2011 - The Canonical Data ZoneOpen Group Conference 2011 - The Canonical Data Zone
Open Group Conference 2011 - The Canonical Data Zone
Gary Farrow
 
IET NW Region - Payment Hub Design
IET NW Region - Payment Hub DesignIET NW Region - Payment Hub Design
IET NW Region - Payment Hub Design
Gary Farrow
 
The Payments Hub Spectrum
The Payments Hub SpectrumThe Payments Hub Spectrum
The Payments Hub Spectrum
Gary Farrow
 
Ad

Similar to Executable Requirements with Behaviour-Driven Development and Cucumber - EuroSTAR 2009 (20)

Cucumber
CucumberCucumber
Cucumber
Farooq Ali
 
Cucumber & BDD
Cucumber & BDDCucumber & BDD
Cucumber & BDD
Sam Davarnia
 
Writing Software not Code with Cucumber
Writing Software not Code with CucumberWriting Software not Code with Cucumber
Writing Software not Code with Cucumber
Ben Mabey
 
Leveling up your JavaScipt - DrupalJam 2017
Leveling up your JavaScipt - DrupalJam 2017Leveling up your JavaScipt - DrupalJam 2017
Leveling up your JavaScipt - DrupalJam 2017
Christian Heilmann
 
Cucumber testing
Cucumber testingCucumber testing
Cucumber testing
Yogesh Waghmare
 
Cucumber testing
Cucumber testingCucumber testing
Cucumber testing
Yogesh Waghmare
 
Dmitry sharkov - Maturing Your Cucumber Suites
Dmitry sharkov   - Maturing Your Cucumber SuitesDmitry sharkov   - Maturing Your Cucumber Suites
Dmitry sharkov - Maturing Your Cucumber Suites
QA or the Highway
 
Impossible Programs
Impossible ProgramsImpossible Programs
Impossible Programs
C4Media
 
Automatisation in development and testing - within budget
Automatisation in development and testing - within budgetAutomatisation in development and testing - within budget
Automatisation in development and testing - within budget
David Lukac
 
Bdd From The Trenches
Bdd From The TrenchesBdd From The Trenches
Bdd From The Trenches
jjggss
 
Progressive web and the problem of JavaScript
Progressive web and the problem of JavaScriptProgressive web and the problem of JavaScript
Progressive web and the problem of JavaScript
Christian Heilmann
 
Green Light for the Apps with Calaba.sh - DroidCon Paris 2014
Green Light for the Apps with Calaba.sh - DroidCon Paris 2014Green Light for the Apps with Calaba.sh - DroidCon Paris 2014
Green Light for the Apps with Calaba.sh - DroidCon Paris 2014
Jean-Loup Yu
 
Dealing with Legacy Perl Code - Peter Scott
Dealing with Legacy Perl Code - Peter ScottDealing with Legacy Perl Code - Peter Scott
Dealing with Legacy Perl Code - Peter Scott
O'Reilly Media
 
DC |> Elixir Meetup - Going off the Rails into Elixir - Dan Ivovich
DC |> Elixir Meetup - Going off the Rails into Elixir - Dan IvovichDC |> Elixir Meetup - Going off the Rails into Elixir - Dan Ivovich
DC |> Elixir Meetup - Going off the Rails into Elixir - Dan Ivovich
SmartLogic
 
JavaScript isn't evil.
JavaScript isn't evil.JavaScript isn't evil.
JavaScript isn't evil.
Christian Heilmann
 
Building Cloud Castles
Building Cloud CastlesBuilding Cloud Castles
Building Cloud Castles
Ben Scofield
 
Eugene Andruszczenko: jQuery
Eugene Andruszczenko: jQueryEugene Andruszczenko: jQuery
Eugene Andruszczenko: jQuery
Refresh Events
 
jQuery Presentation - Refresh Events
jQuery Presentation - Refresh EventsjQuery Presentation - Refresh Events
jQuery Presentation - Refresh Events
Eugene Andruszczenko
 
Rubyconf2016 - Solving communication problems in distributed teams with BDD
Rubyconf2016 - Solving communication problems in distributed teams with BDDRubyconf2016 - Solving communication problems in distributed teams with BDD
Rubyconf2016 - Solving communication problems in distributed teams with BDD
Rodrigo Urubatan
 
RWD in the Wild
RWD in the WildRWD in the Wild
RWD in the Wild
Rich Quick
 
Writing Software not Code with Cucumber
Writing Software not Code with CucumberWriting Software not Code with Cucumber
Writing Software not Code with Cucumber
Ben Mabey
 
Leveling up your JavaScipt - DrupalJam 2017
Leveling up your JavaScipt - DrupalJam 2017Leveling up your JavaScipt - DrupalJam 2017
Leveling up your JavaScipt - DrupalJam 2017
Christian Heilmann
 
Dmitry sharkov - Maturing Your Cucumber Suites
Dmitry sharkov   - Maturing Your Cucumber SuitesDmitry sharkov   - Maturing Your Cucumber Suites
Dmitry sharkov - Maturing Your Cucumber Suites
QA or the Highway
 
Impossible Programs
Impossible ProgramsImpossible Programs
Impossible Programs
C4Media
 
Automatisation in development and testing - within budget
Automatisation in development and testing - within budgetAutomatisation in development and testing - within budget
Automatisation in development and testing - within budget
David Lukac
 
Bdd From The Trenches
Bdd From The TrenchesBdd From The Trenches
Bdd From The Trenches
jjggss
 
Progressive web and the problem of JavaScript
Progressive web and the problem of JavaScriptProgressive web and the problem of JavaScript
Progressive web and the problem of JavaScript
Christian Heilmann
 
Green Light for the Apps with Calaba.sh - DroidCon Paris 2014
Green Light for the Apps with Calaba.sh - DroidCon Paris 2014Green Light for the Apps with Calaba.sh - DroidCon Paris 2014
Green Light for the Apps with Calaba.sh - DroidCon Paris 2014
Jean-Loup Yu
 
Dealing with Legacy Perl Code - Peter Scott
Dealing with Legacy Perl Code - Peter ScottDealing with Legacy Perl Code - Peter Scott
Dealing with Legacy Perl Code - Peter Scott
O'Reilly Media
 
DC |> Elixir Meetup - Going off the Rails into Elixir - Dan Ivovich
DC |> Elixir Meetup - Going off the Rails into Elixir - Dan IvovichDC |> Elixir Meetup - Going off the Rails into Elixir - Dan Ivovich
DC |> Elixir Meetup - Going off the Rails into Elixir - Dan Ivovich
SmartLogic
 
Building Cloud Castles
Building Cloud CastlesBuilding Cloud Castles
Building Cloud Castles
Ben Scofield
 
Eugene Andruszczenko: jQuery
Eugene Andruszczenko: jQueryEugene Andruszczenko: jQuery
Eugene Andruszczenko: jQuery
Refresh Events
 
jQuery Presentation - Refresh Events
jQuery Presentation - Refresh EventsjQuery Presentation - Refresh Events
jQuery Presentation - Refresh Events
Eugene Andruszczenko
 
Rubyconf2016 - Solving communication problems in distributed teams with BDD
Rubyconf2016 - Solving communication problems in distributed teams with BDDRubyconf2016 - Solving communication problems in distributed teams with BDD
Rubyconf2016 - Solving communication problems in distributed teams with BDD
Rodrigo Urubatan
 
RWD in the Wild
RWD in the WildRWD in the Wild
RWD in the Wild
Rich Quick
 
Ad

More from Aslak Hellesøy (7)

2017 03-20-testable-architecture-bddx bytes
2017 03-20-testable-architecture-bddx bytes2017 03-20-testable-architecture-bddx bytes
2017 03-20-testable-architecture-bddx bytes
Aslak Hellesøy
 
Desigining for evolvability
Desigining for evolvabilityDesigining for evolvability
Desigining for evolvability
Aslak Hellesøy
 
2010 10 23 Kanban Smidig2009
2010 10 23 Kanban Smidig20092010 10 23 Kanban Smidig2009
2010 10 23 Kanban Smidig2009
Aslak Hellesøy
 
Cuke4Duke JavaZone 2009
Cuke4Duke JavaZone 2009Cuke4Duke JavaZone 2009
Cuke4Duke JavaZone 2009
Aslak Hellesøy
 
Ruby presentasjon på NTNU 22 april 2009
Ruby presentasjon på NTNU 22 april 2009Ruby presentasjon på NTNU 22 april 2009
Ruby presentasjon på NTNU 22 april 2009
Aslak Hellesøy
 
Ruby presentasjon på NTNU 22 april 2009
Ruby presentasjon på NTNU 22 april 2009Ruby presentasjon på NTNU 22 april 2009
Ruby presentasjon på NTNU 22 april 2009
Aslak Hellesøy
 
Ruby presentasjon på NTNU 22 april 2009
Ruby presentasjon på NTNU 22 april 2009Ruby presentasjon på NTNU 22 april 2009
Ruby presentasjon på NTNU 22 april 2009
Aslak Hellesøy
 
2017 03-20-testable-architecture-bddx bytes
2017 03-20-testable-architecture-bddx bytes2017 03-20-testable-architecture-bddx bytes
2017 03-20-testable-architecture-bddx bytes
Aslak Hellesøy
 
Desigining for evolvability
Desigining for evolvabilityDesigining for evolvability
Desigining for evolvability
Aslak Hellesøy
 
2010 10 23 Kanban Smidig2009
2010 10 23 Kanban Smidig20092010 10 23 Kanban Smidig2009
2010 10 23 Kanban Smidig2009
Aslak Hellesøy
 
Ruby presentasjon på NTNU 22 april 2009
Ruby presentasjon på NTNU 22 april 2009Ruby presentasjon på NTNU 22 april 2009
Ruby presentasjon på NTNU 22 april 2009
Aslak Hellesøy
 
Ruby presentasjon på NTNU 22 april 2009
Ruby presentasjon på NTNU 22 april 2009Ruby presentasjon på NTNU 22 april 2009
Ruby presentasjon på NTNU 22 april 2009
Aslak Hellesøy
 
Ruby presentasjon på NTNU 22 april 2009
Ruby presentasjon på NTNU 22 april 2009Ruby presentasjon på NTNU 22 april 2009
Ruby presentasjon på NTNU 22 april 2009
Aslak Hellesøy
 

Recently uploaded (20)

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
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
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
 
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
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
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
 
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
organizerofv
 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
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
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
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
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded DevelopersLinux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Toradex
 
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
 
Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.
hpbmnnxrvb
 
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
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
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
 
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
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
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
 
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
organizerofv
 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
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
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
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
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded DevelopersLinux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Toradex
 
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
 
Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.
hpbmnnxrvb
 

Executable Requirements with Behaviour-Driven Development and Cucumber - EuroSTAR 2009

  • 1. Executable Requirements with BDD and http://cukes.info/ Aslak Hellesøy - Chief Scientist @aslak_hellesoy [email protected]
  • 2. BDD: Dual audience Stakeholders Testers Users Programmers
  • 6. User Story Sign up In order to avoid manual work participants should be able to sign up on the web
  • 7. User Story Sign up In order to avoid manual work participants should be able to sign up on the web
  • 8. User Story Sign up In order to avoid manual work participants should be able to sign up on the web
  • 9. User Story Sign up In order to avoid manual work participants should be able to sign up on the web
  • 12. Acceptance Given I am on the signup page And I have filled in the form When I click “sign up” Then I should get email confirm. Given... When... Then...
  • 13. Acceptance They are examples! Given I am on the signup page And I have filled in the form When I click “sign up” Then I should get email confirm. Given... When... Then...
  • 18. 80000 downloads http://www.flickr.com/photos/twose/887903401/
  • 19. 80000 downloads 1550 followers http://www.flickr.com/photos/twose/887903401/
  • 20. 80000 downloads 1550 followers 180 contributors http://www.flickr.com/photos/twose/887903401/
  • 21. 80000 downloads 1550 followers 180 contributors 65 wiki pages http://www.flickr.com/photos/twose/887903401/
  • 22. 80000 downloads 1550 followers 180 contributors 65 wiki pages 40 tools http://www.flickr.com/photos/twose/887903401/
  • 23. 80000 downloads 1550 followers 180 contributors 65 wiki pages 40 tools 20 screencasts http://www.flickr.com/photos/twose/887903401/
  • 24. 80000 downloads 1550 followers 180 contributors 65 wiki pages 40 tools 20 screencasts 60 in #cucumber http://www.flickr.com/photos/twose/887903401/
  • 25. 80000 downloads 1550 followers 180 contributors 65 wiki pages 40 tools 20 screencasts 60 in #cucumber #7 on Github http://www.flickr.com/photos/twose/887903401/
  • 30. # language: en Feature: Division In order to avoid silly mistakes Cashiers must be able to calculate a fraction Scenario: Regular numbers Given I have entered 3 into the calculator And I have entered 2 into the calculator When I press divide Then the result should be 1.5 on the screen
  • 31. # language: ja : : 3 2 divide 1.5
  • 32. OH HAI: STUFFING MISHUN: CUCUMBR I CAN HAZ IN TEH BEGINNIN "3" CUCUMBRZ WEN I EAT "2" CUCUMBRZ DEN I HAZ "2" CUCUMBERZ IN MAH BELLY AN IN TEH END "1" CUCUMBRZ KTHXBAI!
  • 33. # language: no Egenskap: Summering For å slippe å gjøre dumme feil Som en regnskapsfører Vil jeg kunne legge sammen Scenario: to tall Gitt at jeg har tastet inn 5 Og at jeg har tastet inn 7 Når jeg summerer Så skal resultatet være 12
  • 34. magyar български Bahasa Indonesia català italiano Cymraeg lietuvių kalba русский Česky latviešu Svenska dansk Nederlands Slovensky Deutsch norsk Узбекча English polski Tiếng Việt Australian português LOLCAT română Texan suomi español français ‫עברית‬ eesti keel hrvatski ‫ﺍﻟﻌﺮﺑﻴﺔ‬
  • 36. $ cucumber features/division.feature # language: en Feature: Division In order to avoid silly mistakes Cashiers must be able to calculate a fraction Scenario: Regular numbers # features/division.feature:6 Given I have entered 3 into the calculator # features/division.feature:7 And I have entered 2 into the calculator # features/division.feature:8 When I press divide # features/division.feature:9 Then the result should be 1.5 on the screen # features/division.feature:10 1 scenario (1 undefined) 4 steps (4 undefined) 0m0.005s
  • 37. You can implement step definitions for undefined steps with these snippets: Given /^I have entered 3 into the calculator$/ do pending end Given /^I have entered 2 into the calculator$/ do pending end When /^I press divide$/ do pending end Then /^the result should be 1.5 on the screen$/ do pending end If you want snippets in a different programming language, just make sure a file with the appropriate file extension exists where cucumber looks for step definitions.
  • 38. features division.feature step_definitions calculator_steps.rb
  • 39. Given /I have entered (d+) into the calculator/ do |n| @calc.push n.to_i end When /I press (w+)/ do |op| @result = @calc.send op end Then /the result should be (.*) on the screen/ do |result| @result.should == result.to_f end
  • 40. features division.feature step_definitions calculator_steps.rb lib calculator.rb
  • 41. $ cucumber features/division.feature # language: en Feature: Division In order to avoid silly mistakes Cashiers must be able to calculate a fraction Scenario: Regular numbers # features/division.feature:6 Given I have entered 3 into the calculator # features/step_definitons/calculator_steps.rb:14 And I have entered 2 into the calculator # features/step_definitons/calculator_steps.rb:14 When I press divide # features/step_definitons/calculator_steps.rb:18 Then the result should be 1.5 on the screen # features/step_definitons/calculator_steps.rb:22 1 scenario (1 passed) 4 steps (4 passed) 0m0.005s
  • 42. Steps & Step Given the secret code is "r g y c" @Given("^the secret code is "([^"]*)"$") public void theSecretCodeIs(String code) { game = new Game(code); }
  • 43. Scenario Outline Scenario Outline: submit guess Given the secret code is "<code>" When I guess "<guess>" Then the mark should be "<mark>" Examples: | code | guess | mark | | r g y c | r g y c | bbbb | | r g y c | r g c y | bbww | | r g y c | y r g c | bwww | | r g y c | c r g y | wwww |
  • 44. Multiline args (String) Then [email protected] should get email """ Hi [email protected] Congratulations, Cucumberer was accepted. See you at JavaZone! """ @Then("^(.*) should get email$") public void email(String email, String body) { }
  • 45. Multiline args (Tables) Given the following proposals | email | title | | [email protected] | Cucumber | | [email protected] | Webrat | @Given("^the following proposals$") public void proposals(cuke4duke.Table proposals) { }
  • 46. Background Feature: Notification emails Background: Given the following proposals exist | email | title | | [email protected] | Cucumber | | [email protected] | Webrat | Scenario: Approve all Scenario: Reject Webrat
  • 47. Tags Feature: Take over the world I want it all @spanish @french @english Scenario: Take over Europe @spanish @english Scenario: Take over America @english Scenario: Take over Australia
  • 48. Tags cucumber -t spanish doit.feature Feature: Take over the world I want it all @spanish @french @english Scenario: Take over Europe @spanish @english Scenario: Take over America @english Scenario: Take over Australia
  • 49. Tags Feature: Take over the world I want it all @spanish @french @english Scenario: Take over Europe @spanish @english Scenario: Take over America @english Scenario: Take over Australia
  • 50. Tags cucumber -t ~french doit.feature Feature: Take over the world I want it all @spanish @french @english Scenario: Take over Europe @spanish @english Scenario: Take over America @english Scenario: Take over Australia
  • 51. Formatters Pretty Progress Profile HTML JUnit Rerun Your Own

Editor's Notes

  • #2: BEKK - Consulting Agile 2002 Open Source 2001 Author of Cucumber Free, open source BDD Slides different (Dorothy) - will upload to Slideshare and tweet.
  • #3: Cucumber based on BDD Reframing of TDD - test before code Requirements before code Communication via examples Automation
  • #4: Getting the words right Examples later
  • #5: Never lose track of business value (WHY) Verification all the time
  • #6: Requirement Use Case
  • #7: How to test? How to develop?
  • #8: How to test? How to develop?
  • #9: How to test? How to develop?
  • #10: Lack of this: Common reason for failure and delay
  • #11: Unambiguous ones
  • #12: Detailed requirement This is also a test Written before code Automated
  • #13: Translate to Cucumber test
  • #14: Leading BDD tool Dozens of clones 1 year old - mature Mindblowing
  • #15: Big ecosystem By far the most popular BDD tool out there
  • #16: Big ecosystem By far the most popular BDD tool out there
  • #17: Big ecosystem By far the most popular BDD tool out there
  • #18: Big ecosystem By far the most popular BDD tool out there
  • #19: Big ecosystem By far the most popular BDD tool out there
  • #20: Big ecosystem By far the most popular BDD tool out there
  • #21: Big ecosystem By far the most popular BDD tool out there
  • #22: Big ecosystem By far the most popular BDD tool out there
  • #23: Big ecosystem By far the most popular BDD tool out there
  • #24: Print this month
  • #25: Written in Ruby Ruby is 16 - can sleep with other languages See all the JVM ones?
  • #26: All the JVM language support
  • #27: Language - you have seen a little What the testers use I will show you the language features AND the flow of usage
  • #28: Icon means Gherkin Remember the user story? (Different example) English as native language?
  • #29: Who has cats Keywords are translated 38 languages Reason it&amp;#x2019;s popular Samisk
  • #30: Who has cats Keywords are translated 38 languages Reason it&amp;#x2019;s popular Samisk
  • #31: Who has cats Keywords are translated 38 languages Reason it&amp;#x2019;s popular Samisk
  • #32: Language - you have seen a little Treetop Ragel Show the res of the language Simple - for biz
  • #33: At the root of your project
  • #34: Run it
  • #35: Scroll down
  • #36: Past the code Can be Java, Scala, Groovy, C# etc.
  • #37: The programmers hook it up to the code. Code doesn&amp;#x2019;t exist yet.
  • #38: We fix it
  • #40: LEARN REGEXP AS MANY AS YOU WANT SAME NUMBER GENERATED FOR YOU
  • #41: Mastermind game
  • #42: Python string Exception to previous rule. Extra stepdef arg
  • #43: Store in Hibernate? Diff Hashes Raw Transpose Map cols and rows
  • #48: JUnit handy for Hudson
  • #49: Incredible what people tweet about #cucumber (Not all of it related to the tool) Salad and drinks Some other things :-)