SlideShare a Scribd company logo
Cucumber
collaboration   language
discussion      value
customers       acceptance


                             Joseph Wilk
Why are you here?
Why are you here?
In order ...
Why are you here?
In order ...
As a Underground attendee
Why are you here?
In order ...
As a Underground attendee
I want ...
Why are you here?
In order ...
As a Underground attendee
I want ...
                    Iā€™ll show you a
                        good time
Whatā€™s your acceptance
       criteria?
Scenario: Ecstatic Underground attendees
 Given people turned up
 When Joseph talks
 Then everyone should learn something new
 And no-one should fall asleep
 And no cucumbers should be thrown
Pass
Fail
Pass
 Fail
How do you know
  your ļ¬nished?
           Youā€™ll know
            when Iā€™m
             ļ¬nished
Outside-in
    User
   Browser
Outside-in
    User
   Browser

   Views
Outside-in
     User
   Browser

    Views


  Controllers
   Models
ā€œI believe that the hardest part of software projects, the
most common source of project failure, is
communication with the customers and users of
that software.

By providing a clear yet precise language to deal
with domains, a DSL can help improve this
communication.ā€

                                          Martin Fowler
def given_ruby_provides_a_great_dsl(*arg)
  developers.should be_happy
end

given_ruby_provides_a_great_dsl 'run away!'
def given_ruby_provides_a_great_dsl(*arg)
  developers.should be_happy
end

given_ruby_provides_a_great_dsl 'run away!'




                    Developer
Why do I
                          quote things?

                            Why can
Underscores!              I not use ā€˜ $




               Customer
Customer            Developer




           Tester
Customer            Developer




           Tester
Customer                    Developer



           Microsoft Word




                   Tester
Customer                 Developer



           Cucumber




                Tester
Customer                        Developer

           Plaintext     Ruby




                       Tester
For Cuke Sake Why?
ā€¢ Token Conversation
ā€¢ Acceptance Criteria
ā€¢ Design
ā€¢ Documentation
ā€¢ Functional test
ā€¢ Integration test
Cucumber Feature
             Feature: Be awesome          Not
               Narrative                executed
Example of
             Scenario: title
behaviour
                      which rocks
               Given <some context>
               And <yet more context>
               When <some action>
 Steps
               And <more actions>
               Then <some outcome>
               And <more outcomes>
Cucumber Feature
             Feature: Be awesome          Not
               Narrative                executed
Example of
             Scenario: title
behaviour
                      which rocks
               Given <some context>
               And <yet more context>
               When <some action>
 Steps
               And <more actions>
               Then <some outcome>
               And <more outcomes>
Plaintext




Ruby               Plaintext
       Plaintext


        Ruby
        Ruby
Plaintext

Step   Given a foaming cuke




              Ruby               Plaintext
                     Plaintext


                      Ruby
                      Ruby
Plaintext

  Step      Given a foaming cuke




                   Ruby               Plaintext
                          Plaintext
            Given /^a foaming (.*)$/i do |fruit|
  Step        fruit.should == 'cukes'
              #assert_equal(fruit, 'cukes')
deļ¬nition   end

                           Ruby
                           Ruby
Plaintext

  Step      Given a foaming cuke




                                               regexp match
                   Ruby               Plaintext
                          Plaintext
            Given /^a foaming (.*)$/i do |fruit|
  Step        fruit.should == 'cukes'
              #assert_equal(fruit, 'cukes')
deļ¬nition   end

                           Ruby
                           Ruby
Cucumber provides the
      venue

                       Sinatra




                        Rails
           Cuke4Duke
Cucumber Gateway?
                               World
                             domination?




                           Cucumber

    Java Virtual Machine




                                Clojure
Cucumber   English
Cucumber   English
Š¾Š³ŃƒŃ€ŠµŃ†       Russian
concombre    French
             Japanese
OkurkovĆ½     Czech
Gurke        German
Cucumber     English
pepino       Spanish
cetriolo     Italian
agurk        Danish
ā€«ļŗļ³‹ļ»“ļŗŽļŗ­ā€¬        Arabic
ketimun      Indonesian
ā€«×žÖ°×œÖøפְפֹוןā€¬   Hebrew
Cogombre     Catalan
CUCUMBR      LOLCats
Agurk        Norwegian
Š¾Š³ŃƒŃ€ŠµŃ†       Russian                     Korean
concombre    French
                          gurka          Swedish
             Japanese
                          castravete     Romanian
OkurkovĆ½     Czech
                          ogĆ³rek         Polish
Gurke        German
Cucumber     English      Kurk           Estonian
pepino       Spanish      dĘ°a chuį»™t      Vietnamese
cetriolo     Italian      uhorka         Slovak
agurk        Danish       gurÄ·is         Latvian
ā€«ļŗļ³‹ļ»“ļŗŽļŗ­ā€¬        Arabic       Agurkas        Lithuanian
ketimun      Indonesian   SalƔtauborka   Hungarian
ā€«×žÖ°×œÖøפְפֹוןā€¬   Hebrew
                          Kurkku         Finnish
Cogombre     Catalan
                          ŠšŃ€Š°ŃŃ‚Š°Š²ŠøцŠ°     Bulgarian
CUCUMBR      LOLCats
Agurk        Norwegian    Pepino         Portuguese
# language: en-au
Crikey: Eating

  Mate: cucumbers
    Ya now how I have 3 cucumbers
    When I eat 2 cucumbers
    Ya gotta have 2 cucumbers in the belly
    N I have 1 cucumber left



YaNowHow /^I have (d+) cucumbers$/ do |n|
  @basket = Basket.new(n.to_i)
end

When /^I eat (d+) cucumbers$/ do |n|
  @belly = Belly.new
  @belly.eat(@basket.take(n.to_i))
end

YaGotta /^have (d+) cucumbers in the belly$/ do |n|
  @belly.cukes.should == n.to_i
end
How Cucumber
supports 28+ languages
How Cucumber
     supports 28+ languages


grammar Feature
  ...
end
How Cucumber
       supports 28+ languages


grammar Feature
  ...
end


compiled



       Ruby
How Cucumber
       supports 28+ languages


grammar Feature   grammar <%= keywords('grammar_name', true) %>
  ...               rule step_keyword
end                   (<%= keywords('given') %>) /
                      (<%= keywords('when') %>) /
                      (<%= keywords('then') %>) /
compiled
                      (<%= keywords('and') %>) /
                      (<%= keywords('but') %>)
                    end
       Ruby         ...
                  end
"en-lol":                          "en-au":
  name: LOLCAT                       name: Australian
  native: LOLCAT                     native: Australian
  encoding: UTF-8                    encoding: UTF-8
  feature: OH HAI                    feature: Crikey
  background: B4                     background: Background
  scenario: MISHUN                   scenario: Mate
  scenario_outline: MISHUN SRSLY     scenario_outline: Blokes
  examples: EXAMPLZ                  examples: Cobber
  given: I CAN HAZ                   given: Ya know how
  when: WEN                          when: When
  then: DEN                          then: Ya gotta
  and: AN                            and: N
  but: BUT                           but: Cept
  space_after_keyword: true          space_after_keyword: true
Webrat
 Love
visit home_path
click_link "Web"
ļ¬ll_in "Email", :with => "Ratā€
click_button "Love"
                                 Bansky
Once more
    unto the breach,
      dear friends
brace yourself
Ā§
Feature Request
I want members to be able to
rent a movie with a priority
indicating how much they
want to see the film
Talk
                   to me




Token for Conversation
Story

Story: Film Member selects a movie to rent with priority
  As a Film member
  I want to add movies to my rental list with a priority
  So that ...
Story

Story: Film Member selects a movie to rent with priority
  As a Film member
  I want to add movies to my rental list with a priority
  So that ...




          Give me the movie
               NOW!
Feature Injection

Feature: Film Member selects a movie to rent with priority
  In order to maximise allocation of films
  The Stock department
  Wants Film members to add movies to their rental list with
  a priority
Feature Injection
Value
        Feature: Film Member selects a movie to rent with priority
          In order to maximise allocation of films
          The Stock department
          Wants Film members to add movies to their rental list with
          a priority
Feature Injection
Value
        Feature: Film Member selects a movie to rent with priority
          In order to maximise allocation of films
          The Stock department
          Wants Film members to add movies to their rental list with
Role      a priority
Feature Injection
Value
        Feature: Film Member selects a movie to rent with priority
          In order to maximise allocation of films
          The Stock department
          Wants Film members to add movies to their rental list with
Role      a priority



                          Role
Feature Injection
Value
        Feature: Film Member selects a movie to rent with priority
          In order to maximise allocation of films
          The Stock department
          Wants Film members to add movies to their rental list with
Role      a priority



                          Role                                Feature
Are we


   Acceptance
                     done yet?




Deļ¬nition of Done.
Scenarios
Feature: Film Member selects a movie to rent with priority
  In order to maximise allocation of films
  The Stock department
  Wants Film members to add movies to their rental list with
  a priority

  Scenario: High priority
Scenarios
Feature: Film Member selects a movie to rent with priority
  In order to maximise allocation of films
  The Stock department
  Wants Film members to add movies to their rental list with
  a priority

  Scenario: High priority
   Given I'm logged in
   And I am viewing the movie "Casshern"
   When I choose "High priority"
   And I press "Rent"
   Then I should see "My rental list"
   And I should see "Casshern" in my rental list
   And "Casshern" should be marked as "High priority"
http://iphonemockup.lkmc.ch
Cuking time

   About
cuking time!
High Res: http://www.screencast.com/t/HbvPTbGy

   Low Res: http://www.vimeo.com/5751831
Hereā€™s one I Cuked
      earlier

 Tasty
High Res: http://www.screencast.com/t/2E4nfzXotZ

    Low Res: http://www.vimeo.com/5751873
Getting Customers
 using Cucumber
Getting Customers
 using Cucumber

           I donā€™t
            bite
The Art of
       War Plaintext
                   ,                                               ,
                  @"===,                                  ,_____cctI
                  "?AAAAAAAAAAAAAAAA,,,,,,,,,,,,,,,,,,,,,;LLLLLLLLLL
       ~",,,       1""""""""""""###OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
        '"EEEEE, !'"***"~~~~~~"OOOIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
           ,EEEEE)>"'''???????"WWW!MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
             "E.,)+="WWW~~~~~~#"OOO1OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
         ,~:#")LLL!"+++???????"$$$1==========##/
          &LLLLLLLLL;;;;;;;;;;;;,,,/
          1#LLLLLLLLLLLLLLLLLLLLLL!
        ,!###LLLLLL"'EEEE,'"LLLLL!
        !######LLL" "EEE" "LLLL"
       !#########L!    "EEJ. "LL!
      !##########1       "JJ*,l"
    !############"!         ,l"
    1##########" 1"~~,~~"
   !##########"
  !###########!
  !###########1
 !############!
 1#############
!"#############"
!##############!
1##########"'                               A magnum, By calendron
1#####"'
"""""
Donā€™t force
              Feature: Title
                In order to <value>
                As a <role>

 structure      I want <feature>
Avoid Noise!
               Given I am able to login
               Given I am able to login
Avoid       Given I login
                Given I authenticate

Inconsistency   Given I gain access
Given   I go to the login page


 Balance
              And I   fill in "username" with "cuke"
              And I   fill in "password" with "cuker"
              And I   click "login"

Abstraction   Given I'm logged in
Use Language
               Building blocks
Given /Iā€™m logged in/ do
  User.create!(:user => 'josephwilk', :password => "pass")
  Given 'I fill in "password" with "josephwilk"'
  Given 'I fill in "password" with "pass"'
  Given 'I click "login"'
end
Email        Email-spec

Webpages     Webrat

Forms        Webrat




Java/Swing   Swinger
Gherkin Metrics?
             Lack of narrative
# language: en-au
Crikey: Eating

  Mate: cucumbers                            Number
    Ya now how I have 3 cucumbers
    When I eat 2 cucumbers                   of steps
    Ya gotta have 2 cucumbers in the belly
    N I have 1 cucumber left




Number of                   Semantically
noise words                similar words
Need for SPEED


Slick wheels!
Spork
require 'rubygems'
require 'spork'

# Sets up the Rails environment for Cucumber
ENV["RAILS_ENV"] ||= "cucumber"

Spork.prefork do
                                                   $ spork cuc
  # Load all the heavy stuff...
end

Spork.each_run do
                                               $ cucumber --drb ...
  # Load the stuff just for this run...

  Before do
    Pages.delete_all
  end
end
Scaling - TestJour

                        slaves


    master




             features


                                 Bonjour
Need for speed
 Webrat 0.8



Celerity                                   12




  Watir                                    12




Selenium                                    12.9


           0   3.75        7.5       11.25         15
                 start-up time (seconds)
Tagging
Eye   Head

         Teeth
        Foam
        Dribble
Tagging
Feature: Verify billing

 @javascript
 Scenario: Missing product description

  Scenario: Several products




 $ cucumber --tags ~@javascript

 $ cucumber --tags @javascript
Tag Hooks             Before(ā€˜@teleportā€™) do
                        teleport.prepare
Attach code to tags   end
Focused Testing
                          @teleport
                          Feature: Invent teleportation


  Run just enough tests   @money
                          Feature: Make lots of money
Continuous Integration(WIP)
    Fail
  Work in    Pass
             Done
  Pending
  progress

    add       list    $ cucumber --wip
   movies    movies
                                 --tags @WIP
                                 features/
    edit
   movies


   delete
   movies
Limiting Tags in Flow
   Work in
                    Done
   progress

 add add add add
movies movies
   movies movies           $ cucumber --tags @WIP:3
                                      features/
 add add add edit
movies movies
   movies movies                              limit 3 tags


 add add add
           delete
movies movies
   movies movies
Avoiding Unrealistic expectations
Further reading

ā€¢   http://cukes.info

ā€¢   http://wiki.github.com/
    aslakhellesoy/cucumber

ā€¢   http://blog.josephwilk.net
Thanks,
                           Call me
                          sometime



                      joe@josephwilk.net
             http://github.com/josephwilk
http://github.com/aslakhellesoy/cucumber

More Related Content

What's hot

Hybrid Web Applications
Hybrid Web ApplicationsHybrid Web Applications
Hybrid Web Applications
James Da Costa
Ā 
RSpec 2 Best practices
RSpec 2 Best practicesRSpec 2 Best practices
RSpec 2 Best practices
Andrea Reginato
Ā 
BDD with Behat and Symfony2
BDD with Behat and Symfony2BDD with Behat and Symfony2
BDD with Behat and Symfony2
katalisha
Ā 
Selenium Sandwich Part 1: Data driven Selenium
Selenium Sandwich Part 1: Data driven Selenium Selenium Sandwich Part 1: Data driven Selenium
Selenium Sandwich Part 1: Data driven Selenium
Workhorse Computing
Ā 
You're Doing It Wrong
You're Doing It WrongYou're Doing It Wrong
You're Doing It Wrong
bostonrb
Ā 
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
Ā 
Selenium sandwich-2
Selenium sandwich-2Selenium sandwich-2
Selenium sandwich-2
Workhorse Computing
Ā 
Behat - Drupal South 2018
Behat  - Drupal South 2018Behat  - Drupal South 2018
Behat - Drupal South 2018
Berend de Boer
Ā 
"Managing API Complexity". Matthew Flaming, Temboo
"Managing API Complexity". Matthew Flaming, Temboo"Managing API Complexity". Matthew Flaming, Temboo
"Managing API Complexity". Matthew Flaming, Temboo
Yandex
Ā 
Behaviour driven infrastructure
Behaviour driven infrastructureBehaviour driven infrastructure
Behaviour driven infrastructure
Lindsay Holmwood
Ā 
5 Reasons To Love CodeIgniter
5 Reasons To Love CodeIgniter5 Reasons To Love CodeIgniter
5 Reasons To Love CodeIgniternicdev
Ā 
Testing web APIs
Testing web APIsTesting web APIs
Testing web APIs
FDConf
Ā 
So, you want to be a plugin developer?
So, you want to be a plugin developer?So, you want to be a plugin developer?
So, you want to be a plugin developer?
ylefebvre
Ā 
What you can do In WatiR
What you can do In WatiRWhat you can do In WatiR
What you can do In WatiR
Wesley Chen
Ā 
Qpsmtpd
QpsmtpdQpsmtpd
Qpsmtpd
Fred Moyer
Ā 
Drupal8 Front-end Automated Testing
Drupal8 Front-end Automated TestingDrupal8 Front-end Automated Testing
Drupal8 Front-end Automated Testing
Ruben Teijeiro
Ā 

What's hot (19)

Hybrid Web Applications
Hybrid Web ApplicationsHybrid Web Applications
Hybrid Web Applications
Ā 
RSpec 2 Best practices
RSpec 2 Best practicesRSpec 2 Best practices
RSpec 2 Best practices
Ā 
BDD with Behat and Symfony2
BDD with Behat and Symfony2BDD with Behat and Symfony2
BDD with Behat and Symfony2
Ā 
Selenium Sandwich Part 1: Data driven Selenium
Selenium Sandwich Part 1: Data driven Selenium Selenium Sandwich Part 1: Data driven Selenium
Selenium Sandwich Part 1: Data driven Selenium
Ā 
You're Doing It Wrong
You're Doing It WrongYou're Doing It Wrong
You're Doing It Wrong
Ā 
Cucumber testing
Cucumber testingCucumber testing
Cucumber testing
Ā 
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
Ā 
Selenium sandwich-2
Selenium sandwich-2Selenium sandwich-2
Selenium sandwich-2
Ā 
Behat - Drupal South 2018
Behat  - Drupal South 2018Behat  - Drupal South 2018
Behat - Drupal South 2018
Ā 
"Managing API Complexity". Matthew Flaming, Temboo
"Managing API Complexity". Matthew Flaming, Temboo"Managing API Complexity". Matthew Flaming, Temboo
"Managing API Complexity". Matthew Flaming, Temboo
Ā 
Behaviour driven infrastructure
Behaviour driven infrastructureBehaviour driven infrastructure
Behaviour driven infrastructure
Ā 
5 Reasons To Love CodeIgniter
5 Reasons To Love CodeIgniter5 Reasons To Love CodeIgniter
5 Reasons To Love CodeIgniter
Ā 
I Love codeigniter, You?
I Love codeigniter, You?I Love codeigniter, You?
I Love codeigniter, You?
Ā 
Testing web APIs
Testing web APIsTesting web APIs
Testing web APIs
Ā 
So, you want to be a plugin developer?
So, you want to be a plugin developer?So, you want to be a plugin developer?
So, you want to be a plugin developer?
Ā 
What you can do In WatiR
What you can do In WatiRWhat you can do In WatiR
What you can do In WatiR
Ā 
Qpsmtpd
QpsmtpdQpsmtpd
Qpsmtpd
Ā 
Drupal8 Front-end Automated Testing
Drupal8 Front-end Automated TestingDrupal8 Front-end Automated Testing
Drupal8 Front-end Automated Testing
Ā 
Code smells in PHP
Code smells in PHPCode smells in PHP
Code smells in PHP
Ā 

Similar to Cucumber Ru09 Web

Cucumbered
CucumberedCucumbered
Cucumbered
Joseph Wilk
Ā 
Cucumber: 小黃ē“œé©—ꔶęø¬č©¦å·„具
Cucumber: 小黃ē“œé©—ꔶęø¬č©¦å·„具Cucumber: 小黃ē“œé©—ꔶęø¬č©¦å·„具
Cucumber: 小黃ē“œé©—ꔶęø¬č©¦å·„具Wen-Tien Chang
Ā 
Spa2011
Spa2011Spa2011
Spa2011
Joseph Wilk
Ā 
Rocket Fuelled Cucumbers
Rocket Fuelled CucumbersRocket Fuelled Cucumbers
Rocket Fuelled Cucumbers
Joseph Wilk
Ā 
Behavior driven development with calabash for android
Behavior driven development with calabash for androidBehavior driven development with calabash for android
Behavior driven development with calabash for android
Teresa Holfeld
Ā 
Behaviour driven development present
Behaviour driven development presentBehaviour driven development present
Behaviour driven development presentRaul Panjiyar
Ā 
CoffeeScript-Ruby-Tuesday
CoffeeScript-Ruby-TuesdayCoffeeScript-Ruby-Tuesday
CoffeeScript-Ruby-TuesdayEddie Kao
Ā 
Ruby Kaigi 2008 LT
Ruby Kaigi 2008 LTRuby Kaigi 2008 LT
Ruby Kaigi 2008 LT
Motohiro Takayama
Ā 
Testing with Docker
Testing with DockerTesting with Docker
Testing with Docker
toffermann
Ā 
Ruby for PHP developers
Ruby for PHP developersRuby for PHP developers
Ruby for PHP developersMax Titov
Ā 
Cucumber & BDD
Cucumber & BDDCucumber & BDD
Cucumber & BDD
Sam Davarnia
Ā 
Javascriptbootcamp
JavascriptbootcampJavascriptbootcamp
Javascriptbootcamposcon2007
Ā 
Ruby for .NET developers
Ruby for .NET developersRuby for .NET developers
Ruby for .NET developers
Max Titov
Ā 
Smalltalk on rubinius
Smalltalk on rubiniusSmalltalk on rubinius
Smalltalk on rubinius
Konstantin Haase
Ā 
Cucumber
CucumberCucumber
Cucumber
Bachue Zhou
Ā 
Ruby Programming Language - Introduction
Ruby Programming Language - IntroductionRuby Programming Language - Introduction
Ruby Programming Language - Introduction
Kwangshin Oh
Ā 
ManagingPuppetConf 2017: Multiple Configuration Management Tools- Sally Lehma...
ManagingPuppetConf 2017: Multiple Configuration Management Tools- Sally Lehma...ManagingPuppetConf 2017: Multiple Configuration Management Tools- Sally Lehma...
ManagingPuppetConf 2017: Multiple Configuration Management Tools- Sally Lehma...
Puppet
Ā 
Cucumber testing
Cucumber testingCucumber testing
Cucumber testing
Yogesh Waghmare
Ā 
Happy Programming with CoffeeScript
Happy Programming with CoffeeScriptHappy Programming with CoffeeScript
Happy Programming with CoffeeScriptEddie Kao
Ā 
Testing outside of the Ruby World
Testing outside of the Ruby WorldTesting outside of the Ruby World
Testing outside of the Ruby WorldJoseph Wilk
Ā 

Similar to Cucumber Ru09 Web (20)

Cucumbered
CucumberedCucumbered
Cucumbered
Ā 
Cucumber: 小黃ē“œé©—ꔶęø¬č©¦å·„具
Cucumber: 小黃ē“œé©—ꔶęø¬č©¦å·„具Cucumber: 小黃ē“œé©—ꔶęø¬č©¦å·„具
Cucumber: 小黃ē“œé©—ꔶęø¬č©¦å·„具
Ā 
Spa2011
Spa2011Spa2011
Spa2011
Ā 
Rocket Fuelled Cucumbers
Rocket Fuelled CucumbersRocket Fuelled Cucumbers
Rocket Fuelled Cucumbers
Ā 
Behavior driven development with calabash for android
Behavior driven development with calabash for androidBehavior driven development with calabash for android
Behavior driven development with calabash for android
Ā 
Behaviour driven development present
Behaviour driven development presentBehaviour driven development present
Behaviour driven development present
Ā 
CoffeeScript-Ruby-Tuesday
CoffeeScript-Ruby-TuesdayCoffeeScript-Ruby-Tuesday
CoffeeScript-Ruby-Tuesday
Ā 
Ruby Kaigi 2008 LT
Ruby Kaigi 2008 LTRuby Kaigi 2008 LT
Ruby Kaigi 2008 LT
Ā 
Testing with Docker
Testing with DockerTesting with Docker
Testing with Docker
Ā 
Ruby for PHP developers
Ruby for PHP developersRuby for PHP developers
Ruby for PHP developers
Ā 
Cucumber & BDD
Cucumber & BDDCucumber & BDD
Cucumber & BDD
Ā 
Javascriptbootcamp
JavascriptbootcampJavascriptbootcamp
Javascriptbootcamp
Ā 
Ruby for .NET developers
Ruby for .NET developersRuby for .NET developers
Ruby for .NET developers
Ā 
Smalltalk on rubinius
Smalltalk on rubiniusSmalltalk on rubinius
Smalltalk on rubinius
Ā 
Cucumber
CucumberCucumber
Cucumber
Ā 
Ruby Programming Language - Introduction
Ruby Programming Language - IntroductionRuby Programming Language - Introduction
Ruby Programming Language - Introduction
Ā 
ManagingPuppetConf 2017: Multiple Configuration Management Tools- Sally Lehma...
ManagingPuppetConf 2017: Multiple Configuration Management Tools- Sally Lehma...ManagingPuppetConf 2017: Multiple Configuration Management Tools- Sally Lehma...
ManagingPuppetConf 2017: Multiple Configuration Management Tools- Sally Lehma...
Ā 
Cucumber testing
Cucumber testingCucumber testing
Cucumber testing
Ā 
Happy Programming with CoffeeScript
Happy Programming with CoffeeScriptHappy Programming with CoffeeScript
Happy Programming with CoffeeScript
Ā 
Testing outside of the Ruby World
Testing outside of the Ruby WorldTesting outside of the Ruby World
Testing outside of the Ruby World
Ā 

More from Joseph Wilk

Frozenrails2011
Frozenrails2011Frozenrails2011
Frozenrails2011Joseph Wilk
Ā 
Acceptance testing in the land of the startup
Acceptance testing in the land of the startup Acceptance testing in the land of the startup
Acceptance testing in the land of the startup
Joseph Wilk
Ā 
Rubykaigi 2011 Limited Red talk
Rubykaigi 2011 Limited Red talkRubykaigi 2011 Limited Red talk
Rubykaigi 2011 Limited Red talk
Joseph Wilk
Ā 
The Limited Red Society
The Limited Red SocietyThe Limited Red Society
The Limited Red Society
Joseph Wilk
Ā 
The Limited Red Society
The Limited Red Society The Limited Red Society
The Limited Red Society
Joseph Wilk
Ā 
Rubyconf lightning talk
Rubyconf lightning talkRubyconf lightning talk
Rubyconf lightning talkJoseph Wilk
Ā 
Acceptance testing in the land of the startup
Acceptance testing in the land of the startupAcceptance testing in the land of the startup
Acceptance testing in the land of the startupJoseph Wilk
Ā 
Cucumber Patterns Workshop
Cucumber Patterns WorkshopCucumber Patterns Workshop
Cucumber Patterns WorkshopJoseph Wilk
Ā 
Musichackday
MusichackdayMusichackday
Musichackday
Joseph Wilk
Ā 
Dynamic Workflow Pulling the Strings
Dynamic Workflow Pulling the StringsDynamic Workflow Pulling the Strings
Dynamic Workflow Pulling the StringsJoseph Wilk
Ā 
Testing with Ruby
Testing with RubyTesting with Ruby
Testing with Ruby
Joseph Wilk
Ā 

More from Joseph Wilk (11)

Frozenrails2011
Frozenrails2011Frozenrails2011
Frozenrails2011
Ā 
Acceptance testing in the land of the startup
Acceptance testing in the land of the startup Acceptance testing in the land of the startup
Acceptance testing in the land of the startup
Ā 
Rubykaigi 2011 Limited Red talk
Rubykaigi 2011 Limited Red talkRubykaigi 2011 Limited Red talk
Rubykaigi 2011 Limited Red talk
Ā 
The Limited Red Society
The Limited Red SocietyThe Limited Red Society
The Limited Red Society
Ā 
The Limited Red Society
The Limited Red Society The Limited Red Society
The Limited Red Society
Ā 
Rubyconf lightning talk
Rubyconf lightning talkRubyconf lightning talk
Rubyconf lightning talk
Ā 
Acceptance testing in the land of the startup
Acceptance testing in the land of the startupAcceptance testing in the land of the startup
Acceptance testing in the land of the startup
Ā 
Cucumber Patterns Workshop
Cucumber Patterns WorkshopCucumber Patterns Workshop
Cucumber Patterns Workshop
Ā 
Musichackday
MusichackdayMusichackday
Musichackday
Ā 
Dynamic Workflow Pulling the Strings
Dynamic Workflow Pulling the StringsDynamic Workflow Pulling the Strings
Dynamic Workflow Pulling the Strings
Ā 
Testing with Ruby
Testing with RubyTesting with Ruby
Testing with Ruby
Ā 

Recently uploaded

UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
Ā 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
Ā 
Dev Dives: Train smarter, not harder ā€“ active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder ā€“ active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder ā€“ active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder ā€“ active learning and UiPath LLMs for do...
UiPathCommunity
Ā 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
Ā 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
Ā 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
Ā 
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
Ā 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
Ā 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
Ā 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
Ā 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
Ā 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
Ā 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
Ā 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
Ā 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
Ā 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
Ā 
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
Ā 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
Ā 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
Ā 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
Ā 

Recently uploaded (20)

UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
Ā 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Ā 
Dev Dives: Train smarter, not harder ā€“ active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder ā€“ active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder ā€“ active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder ā€“ active learning and UiPath LLMs for do...
Ā 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Ā 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Ā 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
Ā 
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
Ā 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Ā 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
Ā 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Ā 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Ā 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
Ā 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Ā 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Ā 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Ā 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Ā 
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
Ā 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Ā 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Ā 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
Ā 

Cucumber Ru09 Web

  • 1. Cucumber collaboration language discussion value customers acceptance Joseph Wilk
  • 2. Why are you here?
  • 3. Why are you here? In order ...
  • 4. Why are you here? In order ... As a Underground attendee
  • 5. Why are you here? In order ... As a Underground attendee I want ...
  • 6. Why are you here? In order ... As a Underground attendee I want ... Iā€™ll show you a good time
  • 8. Scenario: Ecstatic Underground attendees Given people turned up When Joseph talks Then everyone should learn something new And no-one should fall asleep And no cucumbers should be thrown
  • 11. How do you know your ļ¬nished? Youā€™ll know when Iā€™m ļ¬nished
  • 12. Outside-in User Browser
  • 13. Outside-in User Browser Views
  • 14. Outside-in User Browser Views Controllers Models
  • 15. ā€œI believe that the hardest part of software projects, the most common source of project failure, is communication with the customers and users of that software. By providing a clear yet precise language to deal with domains, a DSL can help improve this communication.ā€ Martin Fowler
  • 16. def given_ruby_provides_a_great_dsl(*arg) developers.should be_happy end given_ruby_provides_a_great_dsl 'run away!'
  • 17. def given_ruby_provides_a_great_dsl(*arg) developers.should be_happy end given_ruby_provides_a_great_dsl 'run away!' Developer
  • 18. Why do I quote things? Why can Underscores! I not use ā€˜ $ Customer
  • 19. Customer Developer Tester
  • 20. Customer Developer Tester
  • 21. Customer Developer Microsoft Word Tester
  • 22. Customer Developer Cucumber Tester
  • 23. Customer Developer Plaintext Ruby Tester
  • 24. For Cuke Sake Why? ā€¢ Token Conversation ā€¢ Acceptance Criteria ā€¢ Design ā€¢ Documentation ā€¢ Functional test ā€¢ Integration test
  • 25. Cucumber Feature Feature: Be awesome Not Narrative executed Example of Scenario: title behaviour which rocks Given <some context> And <yet more context> When <some action> Steps And <more actions> Then <some outcome> And <more outcomes>
  • 26. Cucumber Feature Feature: Be awesome Not Narrative executed Example of Scenario: title behaviour which rocks Given <some context> And <yet more context> When <some action> Steps And <more actions> Then <some outcome> And <more outcomes>
  • 27. Plaintext Ruby Plaintext Plaintext Ruby Ruby
  • 28. Plaintext Step Given a foaming cuke Ruby Plaintext Plaintext Ruby Ruby
  • 29. Plaintext Step Given a foaming cuke Ruby Plaintext Plaintext Given /^a foaming (.*)$/i do |fruit| Step fruit.should == 'cukes' #assert_equal(fruit, 'cukes') deļ¬nition end Ruby Ruby
  • 30. Plaintext Step Given a foaming cuke regexp match Ruby Plaintext Plaintext Given /^a foaming (.*)$/i do |fruit| Step fruit.should == 'cukes' #assert_equal(fruit, 'cukes') deļ¬nition end Ruby Ruby
  • 31. Cucumber provides the venue Sinatra Rails Cuke4Duke
  • 32. Cucumber Gateway? World domination? Cucumber Java Virtual Machine Clojure
  • 33. Cucumber English
  • 34. Cucumber English
  • 35. Š¾Š³ŃƒŃ€ŠµŃ† Russian concombre French Japanese OkurkovĆ½ Czech Gurke German Cucumber English pepino Spanish cetriolo Italian agurk Danish ā€«ļŗļ³‹ļ»“ļŗŽļŗ­ā€¬ Arabic ketimun Indonesian ā€«×žÖ°×œÖøפְפֹוןā€¬ Hebrew Cogombre Catalan CUCUMBR LOLCats Agurk Norwegian
  • 36. Š¾Š³ŃƒŃ€ŠµŃ† Russian Korean concombre French gurka Swedish Japanese castravete Romanian OkurkovĆ½ Czech ogĆ³rek Polish Gurke German Cucumber English Kurk Estonian pepino Spanish dĘ°a chuį»™t Vietnamese cetriolo Italian uhorka Slovak agurk Danish gurÄ·is Latvian ā€«ļŗļ³‹ļ»“ļŗŽļŗ­ā€¬ Arabic Agurkas Lithuanian ketimun Indonesian SalĆ”tauborka Hungarian ā€«×žÖ°×œÖøפְפֹוןā€¬ Hebrew Kurkku Finnish Cogombre Catalan ŠšŃ€Š°ŃŃ‚Š°Š²ŠøцŠ° Bulgarian CUCUMBR LOLCats Agurk Norwegian Pepino Portuguese
  • 37. # language: en-au Crikey: Eating Mate: cucumbers Ya now how I have 3 cucumbers When I eat 2 cucumbers Ya gotta have 2 cucumbers in the belly N I have 1 cucumber left YaNowHow /^I have (d+) cucumbers$/ do |n| @basket = Basket.new(n.to_i) end When /^I eat (d+) cucumbers$/ do |n| @belly = Belly.new @belly.eat(@basket.take(n.to_i)) end YaGotta /^have (d+) cucumbers in the belly$/ do |n| @belly.cukes.should == n.to_i end
  • 39. How Cucumber supports 28+ languages grammar Feature ... end
  • 40. How Cucumber supports 28+ languages grammar Feature ... end compiled Ruby
  • 41. How Cucumber supports 28+ languages grammar Feature grammar <%= keywords('grammar_name', true) %> ... rule step_keyword end (<%= keywords('given') %>) / (<%= keywords('when') %>) / (<%= keywords('then') %>) / compiled (<%= keywords('and') %>) / (<%= keywords('but') %>) end Ruby ... end
  • 42. "en-lol": "en-au": name: LOLCAT name: Australian native: LOLCAT native: Australian encoding: UTF-8 encoding: UTF-8 feature: OH HAI feature: Crikey background: B4 background: Background scenario: MISHUN scenario: Mate scenario_outline: MISHUN SRSLY scenario_outline: Blokes examples: EXAMPLZ examples: Cobber given: I CAN HAZ given: Ya know how when: WEN when: When then: DEN then: Ya gotta and: AN and: N but: BUT but: Cept space_after_keyword: true space_after_keyword: true
  • 43. Webrat Love visit home_path click_link "Web" ļ¬ll_in "Email", :with => "Ratā€ click_button "Love" Bansky
  • 44. Once more unto the breach, dear friends brace yourself
  • 45. Ā§
  • 46. Feature Request I want members to be able to rent a movie with a priority indicating how much they want to see the film
  • 47. Talk to me Token for Conversation
  • 48. Story Story: Film Member selects a movie to rent with priority As a Film member I want to add movies to my rental list with a priority So that ...
  • 49. Story Story: Film Member selects a movie to rent with priority As a Film member I want to add movies to my rental list with a priority So that ... Give me the movie NOW!
  • 50. Feature Injection Feature: Film Member selects a movie to rent with priority In order to maximise allocation of films The Stock department Wants Film members to add movies to their rental list with a priority
  • 51. Feature Injection Value Feature: Film Member selects a movie to rent with priority In order to maximise allocation of films The Stock department Wants Film members to add movies to their rental list with a priority
  • 52. Feature Injection Value Feature: Film Member selects a movie to rent with priority In order to maximise allocation of films The Stock department Wants Film members to add movies to their rental list with Role a priority
  • 53. Feature Injection Value Feature: Film Member selects a movie to rent with priority In order to maximise allocation of films The Stock department Wants Film members to add movies to their rental list with Role a priority Role
  • 54. Feature Injection Value Feature: Film Member selects a movie to rent with priority In order to maximise allocation of films The Stock department Wants Film members to add movies to their rental list with Role a priority Role Feature
  • 55. Are we Acceptance done yet? Deļ¬nition of Done.
  • 56. Scenarios Feature: Film Member selects a movie to rent with priority In order to maximise allocation of films The Stock department Wants Film members to add movies to their rental list with a priority Scenario: High priority
  • 57. Scenarios Feature: Film Member selects a movie to rent with priority In order to maximise allocation of films The Stock department Wants Film members to add movies to their rental list with a priority Scenario: High priority Given I'm logged in And I am viewing the movie "Casshern" When I choose "High priority" And I press "Rent" Then I should see "My rental list" And I should see "Casshern" in my rental list And "Casshern" should be marked as "High priority"
  • 59. Cuking time About cuking time!
  • 60. High Res: http://www.screencast.com/t/HbvPTbGy Low Res: http://www.vimeo.com/5751831
  • 61. Hereā€™s one I Cuked earlier Tasty
  • 62. High Res: http://www.screencast.com/t/2E4nfzXotZ Low Res: http://www.vimeo.com/5751873
  • 64. Getting Customers using Cucumber I donā€™t bite
  • 65. The Art of War Plaintext , , @"===, ,_____cctI "?AAAAAAAAAAAAAAAA,,,,,,,,,,,,,,,,,,,,,;LLLLLLLLLL ~",,, 1""""""""""""###OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO '"EEEEE, !'"***"~~~~~~"OOOIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII ,EEEEE)>"'''???????"WWW!MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM "E.,)+="WWW~~~~~~#"OOO1OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO ,~:#")LLL!"+++???????"$$$1==========##/ &LLLLLLLLL;;;;;;;;;;;;,,,/ 1#LLLLLLLLLLLLLLLLLLLLLL! ,!###LLLLLL"'EEEE,'"LLLLL! !######LLL" "EEE" "LLLL" !#########L! "EEJ. "LL! !##########1 "JJ*,l" !############"! ,l" 1##########" 1"~~,~~" !##########" !###########! !###########1 !############! 1############# !"#############" !##############! 1##########"' A magnum, By calendron 1#####"' """""
  • 66. Donā€™t force Feature: Title In order to <value> As a <role> structure I want <feature>
  • 67. Avoid Noise! Given I am able to login Given I am able to login
  • 68. Avoid Given I login Given I authenticate Inconsistency Given I gain access
  • 69. Given I go to the login page Balance And I fill in "username" with "cuke" And I fill in "password" with "cuker" And I click "login" Abstraction Given I'm logged in
  • 70. Use Language Building blocks Given /Iā€™m logged in/ do User.create!(:user => 'josephwilk', :password => "pass") Given 'I fill in "password" with "josephwilk"' Given 'I fill in "password" with "pass"' Given 'I click "login"' end
  • 71. Email Email-spec Webpages Webrat Forms Webrat Java/Swing Swinger
  • 72. Gherkin Metrics? Lack of narrative # language: en-au Crikey: Eating Mate: cucumbers Number Ya now how I have 3 cucumbers When I eat 2 cucumbers of steps Ya gotta have 2 cucumbers in the belly N I have 1 cucumber left Number of Semantically noise words similar words
  • 74. Spork require 'rubygems' require 'spork' # Sets up the Rails environment for Cucumber ENV["RAILS_ENV"] ||= "cucumber" Spork.prefork do $ spork cuc # Load all the heavy stuff... end Spork.each_run do $ cucumber --drb ... # Load the stuff just for this run... Before do Pages.delete_all end end
  • 75. Scaling - TestJour slaves master features Bonjour
  • 76. Need for speed Webrat 0.8 Celerity 12 Watir 12 Selenium 12.9 0 3.75 7.5 11.25 15 start-up time (seconds)
  • 77. Tagging Eye Head Teeth Foam Dribble
  • 78. Tagging Feature: Verify billing @javascript Scenario: Missing product description Scenario: Several products $ cucumber --tags ~@javascript $ cucumber --tags @javascript
  • 79. Tag Hooks Before(ā€˜@teleportā€™) do teleport.prepare Attach code to tags end
  • 80. Focused Testing @teleport Feature: Invent teleportation Run just enough tests @money Feature: Make lots of money
  • 81. Continuous Integration(WIP) Fail Work in Pass Done Pending progress add list $ cucumber --wip movies movies --tags @WIP features/ edit movies delete movies
  • 82. Limiting Tags in Flow Work in Done progress add add add add movies movies movies movies $ cucumber --tags @WIP:3 features/ add add add edit movies movies movies movies limit 3 tags add add add delete movies movies movies movies
  • 84. Further reading ā€¢ http://cukes.info ā€¢ http://wiki.github.com/ aslakhellesoy/cucumber ā€¢ http://blog.josephwilk.net
  • 85. Thanks, Call me sometime joe@josephwilk.net http://github.com/josephwilk http://github.com/aslakhellesoy/cucumber