SlideShare a Scribd company logo
1 of 52
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/
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

More Related Content

What's hot

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 V3sqoo
 
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 RspecJoseph 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 AccessibleeROI
 
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 BostonRBbostonrb
 

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...
 
Scalar::Footnote
Scalar::FootnoteScalar::Footnote
Scalar::Footnote
 
Web Scraping
Web ScrapingWeb Scraping
Web Scraping
 
Programming For Designers V3
Programming For Designers V3Programming For Designers V3
Programming For Designers V3
 
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
 
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
 
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
 

Viewers also liked

Effective Testing using Behavior-Driven Development
Effective Testing using Behavior-Driven DevelopmentEffective Testing using Behavior-Driven Development
Effective Testing using Behavior-Driven DevelopmentAlexander Kress
 
Strategies for Payment Systems Planning
Strategies for Payment Systems PlanningStrategies for Payment Systems Planning
Strategies for Payment Systems PlanningGary Farrow
 
TDD of HTTP Clients With WebMock
TDD of HTTP Clients With WebMockTDD of HTTP Clients With WebMock
TDD of HTTP Clients With WebMockBartosz 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 ZoneGary Farrow
 
IET NW Region - Payment Hub Design
IET NW Region - Payment Hub DesignIET NW Region - Payment Hub Design
IET NW Region - Payment Hub DesignGary Farrow
 
The Payments Hub Spectrum
The Payments Hub SpectrumThe Payments Hub Spectrum
The Payments Hub SpectrumGary Farrow
 

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
 
Strategies for Payment Systems Planning
Strategies for Payment Systems PlanningStrategies for Payment Systems Planning
Strategies for Payment Systems Planning
 
TDD of HTTP Clients With WebMock
TDD of HTTP Clients With WebMockTDD of HTTP Clients With WebMock
TDD of HTTP Clients With WebMock
 
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
 
IET NW Region - Payment Hub Design
IET NW Region - Payment Hub DesignIET NW Region - Payment Hub Design
IET NW Region - Payment Hub Design
 
Cucumber & gherkin language
Cucumber & gherkin languageCucumber & gherkin language
Cucumber & gherkin language
 
The Payments Hub Spectrum
The Payments Hub SpectrumThe Payments Hub Spectrum
The Payments Hub Spectrum
 

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

Writing Software not Code with Cucumber
Writing Software not Code with CucumberWriting Software not Code with Cucumber
Writing Software not Code with CucumberBen Mabey
 
Leveling up your JavaScipt - DrupalJam 2017
Leveling up your JavaScipt - DrupalJam 2017Leveling up your JavaScipt - DrupalJam 2017
Leveling up your JavaScipt - DrupalJam 2017Christian Heilmann
 
Dmitry sharkov - Maturing Your Cucumber Suites
Dmitry sharkov   - Maturing Your Cucumber SuitesDmitry sharkov   - Maturing Your Cucumber Suites
Dmitry sharkov - Maturing Your Cucumber SuitesQA or the Highway
 
Impossible Programs
Impossible ProgramsImpossible Programs
Impossible ProgramsC4Media
 
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 budgetDavid Lukac
 
Bdd From The Trenches
Bdd From The TrenchesBdd From The Trenches
Bdd From The Trenchesjjggss
 
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 JavaScriptChristian 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 2014Jean-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 ScottO'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 IvovichSmartLogic
 
Building Cloud Castles
Building Cloud CastlesBuilding Cloud Castles
Building Cloud CastlesBen Scofield
 
jQuery Presentation - Refresh Events
jQuery Presentation - Refresh EventsjQuery Presentation - Refresh Events
jQuery Presentation - Refresh EventsEugene Andruszczenko
 
Eugene Andruszczenko: jQuery
Eugene Andruszczenko: jQueryEugene Andruszczenko: jQuery
Eugene Andruszczenko: jQueryRefresh Events
 
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 BDDRodrigo Urubatan
 
RWD in the Wild
RWD in the WildRWD in the Wild
RWD in the WildRich Quick
 

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

Cucumber
CucumberCucumber
Cucumber
 
Cucumber & BDD
Cucumber & BDDCucumber & BDD
Cucumber & BDD
 
Writing Software not Code with Cucumber
Writing Software not Code with CucumberWriting Software not Code with Cucumber
Writing Software not Code with Cucumber
 
Leveling up your JavaScipt - DrupalJam 2017
Leveling up your JavaScipt - DrupalJam 2017Leveling up your JavaScipt - DrupalJam 2017
Leveling up your JavaScipt - DrupalJam 2017
 
Cucumber testing
Cucumber testingCucumber testing
Cucumber testing
 
Cucumber testing
Cucumber testingCucumber testing
Cucumber testing
 
Dmitry sharkov - Maturing Your Cucumber Suites
Dmitry sharkov   - Maturing Your Cucumber SuitesDmitry sharkov   - Maturing Your Cucumber Suites
Dmitry sharkov - Maturing Your Cucumber Suites
 
Impossible Programs
Impossible ProgramsImpossible Programs
Impossible Programs
 
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
 
Bdd From The Trenches
Bdd From The TrenchesBdd From The Trenches
Bdd From The Trenches
 
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
 
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
 
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
 
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
 
JavaScript isn't evil.
JavaScript isn't evil.JavaScript isn't evil.
JavaScript isn't evil.
 
Building Cloud Castles
Building Cloud CastlesBuilding Cloud Castles
Building Cloud Castles
 
jQuery Presentation - Refresh Events
jQuery Presentation - Refresh EventsjQuery Presentation - Refresh Events
jQuery Presentation - Refresh Events
 
Eugene Andruszczenko: jQuery
Eugene Andruszczenko: jQueryEugene Andruszczenko: jQuery
Eugene Andruszczenko: jQuery
 
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
 
RWD in the Wild
RWD in the WildRWD in the Wild
RWD in the Wild
 

More from 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 bytesAslak Hellesøy
 
Desigining for evolvability
Desigining for evolvabilityDesigining for evolvability
Desigining for evolvabilityAslak Hellesøy
 
2010 10 23 Kanban Smidig2009
2010 10 23 Kanban Smidig20092010 10 23 Kanban Smidig2009
2010 10 23 Kanban Smidig2009Aslak 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 2009Aslak 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 2009Aslak 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 2009Aslak Hellesøy
 

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
 
Desigining for evolvability
Desigining for evolvabilityDesigining for evolvability
Desigining for evolvability
 
2010 10 23 Kanban Smidig2009
2010 10 23 Kanban Smidig20092010 10 23 Kanban Smidig2009
2010 10 23 Kanban Smidig2009
 
Cuke4Duke JavaZone 2009
Cuke4Duke JavaZone 2009Cuke4Duke JavaZone 2009
Cuke4Duke JavaZone 2009
 
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
 
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
 
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
 

Recently uploaded

CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 

Recently uploaded (20)

CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 

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 aslak.hellesoy@gmail.com
  • 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/
  • 26.
  • 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 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) { }
  • 45. 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) { }
  • 46. 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
  • 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

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