SlideShare une entreprise Scribd logo
1  sur  67
Télécharger pour lire hors ligne
Cucumbered
 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 FutureRuby attendee
Why are you here?
In order ...
As a FutureRuby attendee
I want ...
Why are you here?
In order ...
As a FutureRuby attendee
I want ...
                     I’ll show you a
                         good time
What’s your acceptance
       criteria?
Scenario: Ecstatic FutureRuby 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
Outside-in


Users




          interface
“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



           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>
Plaintext




 Ruby
 Ruby
Plaintext

Step   Given we like cukes




                      Ruby
                      Ruby
Plaintext

  Step      Given we like cukes




            Given /^we like (.*)$/i do |fruit|
  Step        fruit.should == 'cukes'
              #assert_equal(fruit, 'cukes')
definition   end

                           Ruby
                           Ruby
Plaintext

  Step      Given we like cukes




                                                 regexp match


            Given /^we like (.*)$/i do |fruit|
  Step        fruit.should == 'cukes'
              #assert_equal(fruit, 'cukes')
definition   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-lol
OH HAI: STUFFING

  MISHUN:   CUCUMBR
    I CAN   HAZ IN TEH BEGINNIN 3 CUCUMBRZ
    WEN I   EAT 2 CUCUMBRZ
    DEN I   HAS 2 CUCUMBERZ IN MAH BELLY
    AN IN   TEH END 1 CUCUMBRZ KTHXBAI



ICANHAZ /^IN TEH BEGINNIN (d+) CUCUMBRZ$/ do |n|
  @basket = Basket.new(n.to_i)
end

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

DEN /^I HAS (d+) CUCUMBERZ IN MAH 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
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
Feature Injection

Feature: Film Member selects a movie to rent with priority
  In order to maximise allocation of films
  The Film member
  Needs 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 Film member
          Needs 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 Film member
          Needs to add movies to their rental list with a priority

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

Role
                                                             Feature
Are we


   Acceptance
                     done yet?




Definition of Done.
Scenarios
Feature: Film Member selects a movie to rent with priority
  In order to maximise allocation of films
  The Film member
  Needs 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 Film member
  Needs to add movies to their rental list with a priority

  Scenario: High priority
   Given I'm logged in
   When I touch the movie "Casshern"
   And I touch the "Rent High priority" button
    Then I should see "Movie added to 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!
Low Res: http://www.vimeo.com/5642761


High Res: http://www.screencast.com/t/cZZ2cofHupn
Here’s one I Cuked
      earlier

 Tasty
Low Res: http://www.vimeo.com/5642687


High Res: http://www.screencast.com/t/4JV2VQGMj2G
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
Tagging
Eye   Head

         Teeth
        Foam
        Dribble
Tagging
Feature: Verify billing

 @done
 Scenario: Missing product description

  @in-progress
  Scenario: Several products




 $ cucumber --tags ~@in-progress

 $ cucumber --tags @done
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


 add add add
           delete
movies movies
   movies movies
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

Contenu connexe

Similaire à Cucumbered

Cucumber: 小黃瓜驗收測試工具
Cucumber: 小黃瓜驗收測試工具Cucumber: 小黃瓜驗收測試工具
Cucumber: 小黃瓜驗收測試工具
Wen-Tien Chang
 
Cucumber Presentation Kiev Meet Up
Cucumber Presentation Kiev Meet UpCucumber Presentation Kiev Meet Up
Cucumber Presentation Kiev Meet Up
dimakovalenko
 
Behaviour driven development present
Behaviour driven development presentBehaviour driven development present
Behaviour driven development present
Raul Panjiyar
 
CoffeeScript-Ruby-Tuesday
CoffeeScript-Ruby-TuesdayCoffeeScript-Ruby-Tuesday
CoffeeScript-Ruby-Tuesday
Eddie Kao
 
Behaviour driven infrastructure
Behaviour driven infrastructureBehaviour driven infrastructure
Behaviour driven infrastructure
Lindsay Holmwood
 
Rails Presentation (Anton Dmitriyev)
Rails Presentation (Anton Dmitriyev)Rails Presentation (Anton Dmitriyev)
Rails Presentation (Anton Dmitriyev)
True-Vision
 

Similaire à Cucumbered (20)

Cucumber: 小黃瓜驗收測試工具
Cucumber: 小黃瓜驗收測試工具Cucumber: 小黃瓜驗收測試工具
Cucumber: 小黃瓜驗收測試工具
 
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
 
Spa2011
Spa2011Spa2011
Spa2011
 
Testing with Docker
Testing with DockerTesting with Docker
Testing with Docker
 
Cucumber Presentation Kiev Meet Up
Cucumber Presentation Kiev Meet UpCucumber Presentation Kiev Meet Up
Cucumber Presentation Kiev Meet Up
 
Selenium and Cucumber Selenium Conf 2011
Selenium and Cucumber Selenium Conf 2011Selenium and Cucumber Selenium Conf 2011
Selenium and Cucumber Selenium Conf 2011
 
Rocket Fuelled Cucumbers
Rocket Fuelled CucumbersRocket Fuelled Cucumbers
Rocket Fuelled Cucumbers
 
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
 
Behaviour driven infrastructure
Behaviour driven infrastructureBehaviour driven infrastructure
Behaviour driven infrastructure
 
Esoteric, Obfuscated, Artistic Programming in Ruby
Esoteric, Obfuscated, Artistic Programming in RubyEsoteric, Obfuscated, Artistic Programming in Ruby
Esoteric, Obfuscated, Artistic Programming in Ruby
 
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
 
Testing Adhearsion Applications
Testing Adhearsion ApplicationsTesting Adhearsion Applications
Testing Adhearsion Applications
 
Cucumber testing
Cucumber testingCucumber testing
Cucumber testing
 
Cucumber testing
Cucumber testingCucumber testing
Cucumber testing
 
Ruby Kaigi 2008 LT
Ruby Kaigi 2008 LTRuby Kaigi 2008 LT
Ruby Kaigi 2008 LT
 
BDT on PHP
BDT on PHPBDT on PHP
BDT on PHP
 
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...
 
Rails Presentation (Anton Dmitriyev)
Rails Presentation (Anton Dmitriyev)Rails Presentation (Anton Dmitriyev)
Rails Presentation (Anton Dmitriyev)
 
Smalltalk on rubinius
Smalltalk on rubiniusSmalltalk on rubinius
Smalltalk on rubinius
 

Plus de Joseph Wilk (12)

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
 
Testing outside of the Ruby World
Testing outside of the Ruby WorldTesting outside of the Ruby World
Testing outside of the Ruby World
 
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
 

Dernier

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 

Dernier (20)

08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 

Cucumbered

  • 1. Cucumbered 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 FutureRuby attendee
  • 5. Why are you here? In order ... As a FutureRuby attendee I want ...
  • 6. Why are you here? In order ... As a FutureRuby attendee I want ... I’ll show you a good time
  • 8. Scenario: Ecstatic FutureRuby 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. Outside-in Users interface
  • 12. “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
  • 13. def given_ruby_provides_a_great_dsl(*arg) developers.should be_happy end given_ruby_provides_a_great_dsl 'run away!'
  • 14. def given_ruby_provides_a_great_dsl(*arg) developers.should be_happy end given_ruby_provides_a_great_dsl 'run away!' Developer
  • 15. Why do I quote things? Why can Underscores! I not use ‘ $ Customer
  • 16. Customer Developer Tester
  • 17. Customer Developer Cucumber Tester
  • 18. Customer Developer Plaintext Ruby Tester
  • 19. For Cuke Sake Why? • Token Conversation • Acceptance Criteria • Design • Documentation • Functional test • Integration test
  • 20. 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>
  • 22. Plaintext Step Given we like cukes Ruby Ruby
  • 23. Plaintext Step Given we like cukes Given /^we like (.*)$/i do |fruit| Step fruit.should == 'cukes' #assert_equal(fruit, 'cukes') definition end Ruby Ruby
  • 24. Plaintext Step Given we like cukes regexp match Given /^we like (.*)$/i do |fruit| Step fruit.should == 'cukes' #assert_equal(fruit, 'cukes') definition end Ruby Ruby
  • 25. Cucumber provides the venue Sinatra Rails Cuke4Duke
  • 26. Cucumber Gateway? World domination? Cucumber Java Virtual Machine Clojure
  • 27. Cucumber English
  • 28. Cucumber English
  • 29. огурец 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
  • 30. огурец 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
  • 31. # language: en-lol OH HAI: STUFFING MISHUN: CUCUMBR I CAN HAZ IN TEH BEGINNIN 3 CUCUMBRZ WEN I EAT 2 CUCUMBRZ DEN I HAS 2 CUCUMBERZ IN MAH BELLY AN IN TEH END 1 CUCUMBRZ KTHXBAI ICANHAZ /^IN TEH BEGINNIN (d+) CUCUMBRZ$/ do |n| @basket = Basket.new(n.to_i) end WEN /^I EAT (d+) CUCUMBRZ$/ do |n| @belly = Belly.new @belly.eat(@basket.take(n.to_i)) end DEN /^I HAS (d+) CUCUMBERZ IN MAH BELLY$/ do |n| @belly.cukes.should == n.to_i end
  • 33. How Cucumber supports 28+ languages grammar Feature ... end
  • 34. How Cucumber supports 28+ languages grammar Feature ... end compiled Ruby
  • 35. 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
  • 36. "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
  • 37. Once more unto the breach, dear friends brace yourself
  • 38. §
  • 39. Feature Request I want members to be able to rent a movie with a priority indicating how much they want to see the film
  • 40. Talk to me Token for Conversation
  • 41. Feature Injection Feature: Film Member selects a movie to rent with priority In order to maximise allocation of films The Film member Needs to add movies to their rental list with a priority
  • 42. Feature Injection Value Feature: Film Member selects a movie to rent with priority In order to maximise allocation of films The Film member Needs to add movies to their rental list with a priority
  • 43. Feature Injection Value Feature: Film Member selects a movie to rent with priority In order to maximise allocation of films The Film member Needs to add movies to their rental list with a priority Role
  • 44. Feature Injection Value Feature: Film Member selects a movie to rent with priority In order to maximise allocation of films The Film member Needs to add movies to their rental list with a priority Role Feature
  • 45. Are we Acceptance done yet? Definition of Done.
  • 46. Scenarios Feature: Film Member selects a movie to rent with priority In order to maximise allocation of films The Film member Needs to add movies to their rental list with a priority Scenario: High priority
  • 47. Scenarios Feature: Film Member selects a movie to rent with priority In order to maximise allocation of films The Film member Needs to add movies to their rental list with a priority Scenario: High priority Given I'm logged in When I touch the movie "Casshern" And I touch the "Rent High priority" button Then I should see "Movie added to rental list" And I should see "Casshern" in my rental list And "Casshern" should be marked as "High priority"
  • 49. Cuking time About cuking time!
  • 50. Low Res: http://www.vimeo.com/5642761 High Res: http://www.screencast.com/t/cZZ2cofHupn
  • 51. Here’s one I Cuked earlier Tasty
  • 52. Low Res: http://www.vimeo.com/5642687 High Res: http://www.screencast.com/t/4JV2VQGMj2G
  • 54. Getting Customers using Cucumber I don’t bite
  • 55. 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#####"' """""
  • 56. Don’t force Feature: Title In order to <value> As a <role> structure I want <feature>
  • 57. Avoid Noise! Given I am able to login Given I am able to login
  • 58. Avoid Given I login Given I authenticate Inconsistency Given I gain access
  • 59. 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
  • 60. 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
  • 61. Tagging Eye Head Teeth Foam Dribble
  • 62. Tagging Feature: Verify billing @done Scenario: Missing product description @in-progress Scenario: Several products $ cucumber --tags ~@in-progress $ cucumber --tags @done
  • 63. Focused Testing @teleport Feature: Invent teleportation Run just enough tests @money Feature: Make lots of money
  • 64. Continuous Integration(WIP) Fail Work in Pass Done Pending progress add list $ cucumber --wip movies movies --tags @WIP features/ edit movies delete movies
  • 65. 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 add add add delete movies movies movies movies
  • 66. Further reading • http://cukes.info • http://wiki.github.com/ aslakhellesoy/cucumber • http://blog.josephwilk.net
  • 67. Thanks, Call me sometime joe@josephwilk.net http://github.com/josephwilk http://github.com/aslakhellesoy/cucumber