SlideShare a Scribd company logo
1 of 44
Download to read offline
Behavior Driven Development

                                  Cucumber
                                                              with


                                      Brandon Keepers ● Collective idea ● http://opensoul.org




http://flickr.com/photos/nickatkins/527421404/
Feature: Cucumber
  In order to share the love
  As a presenter
  I will demonstrate behavior driven development with Cucumber

 Scenario: Behavior Driven Development with Cucumber
   Given a desire for higher quality software
   And a tool that executes feature documentation written in plain text
   When you watch this presentation
   Then you will gain an understanding of behavior driven development
   And see examples of behavior driven development with cucumber
   And be equipped to integrate Cucumber into your development process
Quality
1
Quality
meets requirements
Developer


Language
   Client
Developer


Stories
  Client
In order to keep of track movies that I want to see
As a NetFlix customer
I can add movies to a queue




               http://dannorth.net/whats-in-a-story
va l ue p ro p o s i t i o n


In order to keep of track movies that I want to see
As a NetFlix customer
I can add movies to a queue




               http://dannorth.net/whats-in-a-story
In order to keep of track movies that I want to see
As a NetFlix customer            role
I can add movies to a queue




               http://dannorth.net/whats-in-a-story
In order to keep of track movies that I want to see
As a NetFlix customer
I can add movies to a queue


                             e at u re
                         f

               http://dannorth.net/whats-in-a-story
2
Quality
works as expected
Test Driven
Behavior Driven
Verify
Confidence
Design
Behavior
Testing

Specifying
Cucumber

http://flickr.com/photos/nickatkins/527421404/
rbehave

rSpec Story Runner

  Cucumber
http://github.com/aslakhellesoy/cucumber
$ gem install cucumber
Rakefile

require 'rubygems'
require 'cucumber/rake/task'

Cucumber::Rake::Task.new
$ rake features
Rails
$ ruby script/plugin install 
   git://github.com/aslakhellesoy/cucumber.git 
   git://github.com/brynary/webrat.git 
   git://github.com/dchelimsky/rspec.git 
   git://github.com/dchelimsky/rspec-rails.git

$ ruby script/plugin install 
   git://brandon.local/cucumber 
   git://brandon.local/webrat 
   git://brandon.local/rspec 
   git://brandon.local/rspec-rails
Dependencies


$ gem install term-ansicolor 
   treetop diff-lcs hpricot
$ ruby script/generate cucumber
Feature: Manage companies
  In order to keep track of companies
  A user
  Should be able to manage companies

 Scenario: Create a new company
   Given I am logged in
   When I create a new company named Acme
   Then I should see that a company named Acme exists
features/
 companies.feature
 steps/
  company_steps.rb
Given == Setup

Given quot;I am logged inquot; do
  user = Factory(:user)
  visits new_session_path
  fills_in ‘Login’,     :with => user.login
  fills_in ‘Password’, :with => user.password
  clicks_button ‘Login’
end
Given quot;I am logged inquot; do
  user = Factory(:user)
                               f ac t o r y_g i r l
  visits new_session_path
  fills_in ‘Login’,     :with => user.login
  fills_in ‘Password’, :with => user.password
  clicks_button ‘Login’
end

          Factory.sequence(:email) {|n| quot;user#{n}@example.comquot; }
          Factory.define :user do |user|
            user.name 'User'
            user.email { Factory.next(:email) }
            user.login {|u| u.email }
            user.password 'password'
            user.password_confirmation 'password'
          end
Given quot;I am logged inquot; do
  user = Factory(:user)
  visits new_session_path
  fills_in 'Login',     :with => user.login
  fills_in 'Password', :with => user.password
  clicks_button 'Login'
end

                                            we b rat
When == Change


When quot;I create a new company named $namequot; do |name|
  visits new_company_path
  fills_in 'Name', :with => name
  clicks_button 'Create'
end
When == Change
                                   v a r i a ble


When quot;I create a new company named $namequot; do |name|
  visits new_company_path
  fills_in 'Name', :with => name
  clicks_button 'Create'
end


         When I create a new company named Acme
Then == Outcome


Then quot;I should see that a company named $name existsquot; do |name|
  response.body.should =~ Regexp.new(name)
end
Feature: Manage companies
  In order to keep track of companies
  A user
  Should be able to manage companies

 Scenario: Create a new company
   Given I am logged in
   When I create a new company named Acme
   Then I should see that a company named Acme exists

3 steps passsed
Scenario: Paging through leads and rejecting
  Given a company called Apple Corp.
  And a company called Pear Inc.
  And a list for Client A
  And Apple Corp. is a new lead in a list for Client A
  And Pear Inc. is a new lead in a list for Client A
  And I am logged in as a staff member

  When I view the company overview for Apple Corp.
  And I reject Apple Corp.
  And I go to the next lead

  Then I see the company overview for Pear Inc.
Cucumber or RSpec?
Cucumber or RSpec?


 BOTH
http://github.com/bmabey/cucumber-tmbundle/
Feature: Cucumber
  In order to share the love
  As a presenter
  I will demonstrate behavior driven development with Cucumber

  Scenario: Behavior Driven Development with Cucumber
    Given a desire for higher quality software
    And a tool that executes feature documentation written in plain text
    When you watch this presentation
    Then you will gain an understanding of behavior driven development
    And see examples of behavior driven development with cucumber
    And be equipped to integrate Cucumber into your development process

6 steps passed
@bkeepers
github.com/
    brandon
    collectiveidea
opensoul.org
sessions.collectiveidea.com

More Related Content

What's hot

BDD presentation
BDD presentationBDD presentation
BDD presentationtemebele
 
BDD WITH CUCUMBER AND JAVA
BDD WITH CUCUMBER AND JAVABDD WITH CUCUMBER AND JAVA
BDD WITH CUCUMBER AND JAVASrinivas Katakam
 
Introduction to Bdd and cucumber
Introduction to Bdd and cucumberIntroduction to Bdd and cucumber
Introduction to Bdd and cucumberNibu Baby
 
Automation test framework with cucumber – BDD
Automation test framework with cucumber – BDDAutomation test framework with cucumber – BDD
Automation test framework with cucumber – BDD123abcda
 
Bdd – with cucumber and gherkin
Bdd – with cucumber and gherkinBdd – with cucumber and gherkin
Bdd – with cucumber and gherkinArati Joshi
 
Introduction to BDD with Cucumber for Java
Introduction to BDD with Cucumber for JavaIntroduction to BDD with Cucumber for Java
Introduction to BDD with Cucumber for JavaSeb Rose
 
Selenium with Cucumber
Selenium  with Cucumber Selenium  with Cucumber
Selenium with Cucumber Knoldus Inc.
 
What Is Cucumber?
What Is Cucumber?What Is Cucumber?
What Is Cucumber?QATestLab
 
Behavior Driven Development Pros and Cons
Behavior Driven Development Pros and ConsBehavior Driven Development Pros and Cons
Behavior Driven Development Pros and ConsIosif Itkin
 
Behavior driven development (bdd)
Behavior driven development (bdd)Behavior driven development (bdd)
Behavior driven development (bdd)Rohit Bisht
 
BDD in Action – principles, practices and real-world application
BDD in Action – principles, practices and real-world applicationBDD in Action – principles, practices and real-world application
BDD in Action – principles, practices and real-world applicationJohn Ferguson Smart Limited
 
Behavior Driven Development (BDD) and Agile Testing
Behavior Driven Development (BDD) and Agile TestingBehavior Driven Development (BDD) and Agile Testing
Behavior Driven Development (BDD) and Agile Testingdversaci
 

What's hot (20)

BDD presentation
BDD presentationBDD presentation
BDD presentation
 
BDD WITH CUCUMBER AND JAVA
BDD WITH CUCUMBER AND JAVABDD WITH CUCUMBER AND JAVA
BDD WITH CUCUMBER AND JAVA
 
Introduction to Bdd and cucumber
Introduction to Bdd and cucumberIntroduction to Bdd and cucumber
Introduction to Bdd and cucumber
 
Automation test framework with cucumber – BDD
Automation test framework with cucumber – BDDAutomation test framework with cucumber – BDD
Automation test framework with cucumber – BDD
 
Bdd – with cucumber and gherkin
Bdd – with cucumber and gherkinBdd – with cucumber and gherkin
Bdd – with cucumber and gherkin
 
Bdd and spec flow
Bdd and spec flowBdd and spec flow
Bdd and spec flow
 
BDD with Cucumber
BDD with CucumberBDD with Cucumber
BDD with Cucumber
 
Introduction to BDD with Cucumber for Java
Introduction to BDD with Cucumber for JavaIntroduction to BDD with Cucumber for Java
Introduction to BDD with Cucumber for Java
 
Cucumber & gherkin language
Cucumber & gherkin languageCucumber & gherkin language
Cucumber & gherkin language
 
Selenium with Cucumber
Selenium  with Cucumber Selenium  with Cucumber
Selenium with Cucumber
 
Cucumber BDD
Cucumber BDDCucumber BDD
Cucumber BDD
 
BDD & Cucumber
BDD & CucumberBDD & Cucumber
BDD & Cucumber
 
Gherkin /BDD intro
Gherkin /BDD introGherkin /BDD intro
Gherkin /BDD intro
 
What Is Cucumber?
What Is Cucumber?What Is Cucumber?
What Is Cucumber?
 
Behavior Driven Development Pros and Cons
Behavior Driven Development Pros and ConsBehavior Driven Development Pros and Cons
Behavior Driven Development Pros and Cons
 
Behavior driven development (bdd)
Behavior driven development (bdd)Behavior driven development (bdd)
Behavior driven development (bdd)
 
BDD in Action – principles, practices and real-world application
BDD in Action – principles, practices and real-world applicationBDD in Action – principles, practices and real-world application
BDD in Action – principles, practices and real-world application
 
Cucumber_Training_ForQA
Cucumber_Training_ForQACucumber_Training_ForQA
Cucumber_Training_ForQA
 
Behavior Driven Development (BDD) and Agile Testing
Behavior Driven Development (BDD) and Agile TestingBehavior Driven Development (BDD) and Agile Testing
Behavior Driven Development (BDD) and Agile Testing
 
Cucumber presenation
Cucumber presenationCucumber presenation
Cucumber presenation
 

Similar to Behavior Driven Development with Cucumber

Writing Software not Code with Cucumber
Writing Software not Code with CucumberWriting Software not Code with Cucumber
Writing Software not Code with CucumberBen Mabey
 
Behaviour driven infrastructure
Behaviour driven infrastructureBehaviour driven infrastructure
Behaviour driven infrastructureLindsay Holmwood
 
Cucumber: How I Slice It
Cucumber: How I Slice ItCucumber: How I Slice It
Cucumber: How I Slice Itlinoj
 
Introduce cucumber
Introduce cucumberIntroduce cucumber
Introduce cucumberBachue Zhou
 
Double Loop: TDD & BDD Done Right
Double Loop: TDD & BDD Done RightDouble Loop: TDD & BDD Done Right
Double Loop: TDD & BDD Done RightJessica Mauerhan
 
CUCUMBER - Making BDD Fun
CUCUMBER - Making BDD FunCUCUMBER - Making BDD Fun
CUCUMBER - Making BDD FunSQABD
 
Behat - Drupal South 2018
Behat  - Drupal South 2018Behat  - Drupal South 2018
Behat - Drupal South 2018Berend de Boer
 
Behat - human-readable automated testing
Behat - human-readable automated testingBehat - human-readable automated testing
Behat - human-readable automated testingnyccamp
 
Enabling agile devliery through enabling BDD in PHP projects
Enabling agile devliery through enabling BDD in PHP projectsEnabling agile devliery through enabling BDD in PHP projects
Enabling agile devliery through enabling BDD in PHP projectsKonstantin Kudryashov
 
Behat for writing tests in a stylized way
Behat for writing tests in a stylized wayBehat for writing tests in a stylized way
Behat for writing tests in a stylized wayRavindra Singh
 
BDD / cucumber /Capybara
BDD / cucumber /CapybaraBDD / cucumber /Capybara
BDD / cucumber /CapybaraShraddhaSF
 
Behaviour Driven Development
Behaviour Driven DevelopmentBehaviour Driven Development
Behaviour Driven DevelopmentAndy Kelk
 
Beautiful Java EE - PrettyFaces
Beautiful Java EE - PrettyFacesBeautiful Java EE - PrettyFaces
Beautiful Java EE - PrettyFacesLincoln III
 
Transformando os pepinos do cliente no código de testes da sua aplicação
Transformando os pepinos do cliente no código de testes da sua aplicaçãoTransformando os pepinos do cliente no código de testes da sua aplicação
Transformando os pepinos do cliente no código de testes da sua aplicaçãoRodrigo Urubatan
 
Simple Social Networking with Ruby on Rails
Simple Social Networking with Ruby on RailsSimple Social Networking with Ruby on Rails
Simple Social Networking with Ruby on Railsjhenry
 
Mobile App Feature Configuration and A/B Experiments
Mobile App Feature Configuration and A/B ExperimentsMobile App Feature Configuration and A/B Experiments
Mobile App Feature Configuration and A/B Experimentslacyrhoades
 
Getting Started with Test Automation: Introduction to Cucumber with Lapis Lazuli
Getting Started with Test Automation: Introduction to Cucumber with Lapis LazuliGetting Started with Test Automation: Introduction to Cucumber with Lapis Lazuli
Getting Started with Test Automation: Introduction to Cucumber with Lapis LazuliRebecca Eloise Hogg
 

Similar to Behavior Driven Development with Cucumber (20)

Writing Software not Code with Cucumber
Writing Software not Code with CucumberWriting Software not Code with Cucumber
Writing Software not Code with Cucumber
 
Behaviour driven infrastructure
Behaviour driven infrastructureBehaviour driven infrastructure
Behaviour driven infrastructure
 
Cucumber: How I Slice It
Cucumber: How I Slice ItCucumber: How I Slice It
Cucumber: How I Slice It
 
Introduce cucumber
Introduce cucumberIntroduce cucumber
Introduce cucumber
 
Double Loop: TDD & BDD Done Right
Double Loop: TDD & BDD Done RightDouble Loop: TDD & BDD Done Right
Double Loop: TDD & BDD Done Right
 
Cucumber & BDD
Cucumber & BDDCucumber & BDD
Cucumber & BDD
 
CUCUMBER - Making BDD Fun
CUCUMBER - Making BDD FunCUCUMBER - Making BDD Fun
CUCUMBER - Making BDD Fun
 
Behat - Drupal South 2018
Behat  - Drupal South 2018Behat  - Drupal South 2018
Behat - Drupal South 2018
 
Behat - human-readable automated testing
Behat - human-readable automated testingBehat - human-readable automated testing
Behat - human-readable automated testing
 
Enabling agile devliery through enabling BDD in PHP projects
Enabling agile devliery through enabling BDD in PHP projectsEnabling agile devliery through enabling BDD in PHP projects
Enabling agile devliery through enabling BDD in PHP projects
 
Behat for writing tests in a stylized way
Behat for writing tests in a stylized wayBehat for writing tests in a stylized way
Behat for writing tests in a stylized way
 
BDD / cucumber /Capybara
BDD / cucumber /CapybaraBDD / cucumber /Capybara
BDD / cucumber /Capybara
 
Behaviour Driven Development
Behaviour Driven DevelopmentBehaviour Driven Development
Behaviour Driven Development
 
Beautiful Java EE - PrettyFaces
Beautiful Java EE - PrettyFacesBeautiful Java EE - PrettyFaces
Beautiful Java EE - PrettyFaces
 
Transformando os pepinos do cliente no código de testes da sua aplicação
Transformando os pepinos do cliente no código de testes da sua aplicaçãoTransformando os pepinos do cliente no código de testes da sua aplicação
Transformando os pepinos do cliente no código de testes da sua aplicação
 
Simple Social Networking with Ruby on Rails
Simple Social Networking with Ruby on RailsSimple Social Networking with Ruby on Rails
Simple Social Networking with Ruby on Rails
 
Mobile App Feature Configuration and A/B Experiments
Mobile App Feature Configuration and A/B ExperimentsMobile App Feature Configuration and A/B Experiments
Mobile App Feature Configuration and A/B Experiments
 
Getting Started with Test Automation: Introduction to Cucumber with Lapis Lazuli
Getting Started with Test Automation: Introduction to Cucumber with Lapis LazuliGetting Started with Test Automation: Introduction to Cucumber with Lapis Lazuli
Getting Started with Test Automation: Introduction to Cucumber with Lapis Lazuli
 
Seven Reasons for Code Bloat
Seven Reasons for Code BloatSeven Reasons for Code Bloat
Seven Reasons for Code Bloat
 
Integration Testing in Python
Integration Testing in PythonIntegration Testing in Python
Integration Testing in Python
 

Recently uploaded

Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
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 WorkerThousandEyes
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
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 textsMaria Levchenko
 
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 WorkerThousandEyes
 
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)wesley chun
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
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 DevelopmentsTrustArc
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 

Recently uploaded (20)

Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
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
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
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
 
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
 
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)
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
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
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 

Behavior Driven Development with Cucumber

  • 1. Behavior Driven Development Cucumber with Brandon Keepers ● Collective idea ● http://opensoul.org http://flickr.com/photos/nickatkins/527421404/
  • 2. Feature: Cucumber In order to share the love As a presenter I will demonstrate behavior driven development with Cucumber Scenario: Behavior Driven Development with Cucumber Given a desire for higher quality software And a tool that executes feature documentation written in plain text When you watch this presentation Then you will gain an understanding of behavior driven development And see examples of behavior driven development with cucumber And be equipped to integrate Cucumber into your development process
  • 7.
  • 8. In order to keep of track movies that I want to see As a NetFlix customer I can add movies to a queue http://dannorth.net/whats-in-a-story
  • 9. va l ue p ro p o s i t i o n In order to keep of track movies that I want to see As a NetFlix customer I can add movies to a queue http://dannorth.net/whats-in-a-story
  • 10. In order to keep of track movies that I want to see As a NetFlix customer role I can add movies to a queue http://dannorth.net/whats-in-a-story
  • 11. In order to keep of track movies that I want to see As a NetFlix customer I can add movies to a queue e at u re f http://dannorth.net/whats-in-a-story
  • 15.
  • 24. $ gem install cucumber
  • 27. Rails $ ruby script/plugin install git://github.com/aslakhellesoy/cucumber.git git://github.com/brynary/webrat.git git://github.com/dchelimsky/rspec.git git://github.com/dchelimsky/rspec-rails.git $ ruby script/plugin install git://brandon.local/cucumber git://brandon.local/webrat git://brandon.local/rspec git://brandon.local/rspec-rails
  • 28. Dependencies $ gem install term-ansicolor treetop diff-lcs hpricot
  • 30. Feature: Manage companies In order to keep track of companies A user Should be able to manage companies Scenario: Create a new company Given I am logged in When I create a new company named Acme Then I should see that a company named Acme exists
  • 32. Given == Setup Given quot;I am logged inquot; do user = Factory(:user) visits new_session_path fills_in ‘Login’, :with => user.login fills_in ‘Password’, :with => user.password clicks_button ‘Login’ end
  • 33. Given quot;I am logged inquot; do user = Factory(:user) f ac t o r y_g i r l visits new_session_path fills_in ‘Login’, :with => user.login fills_in ‘Password’, :with => user.password clicks_button ‘Login’ end Factory.sequence(:email) {|n| quot;user#{n}@example.comquot; } Factory.define :user do |user| user.name 'User' user.email { Factory.next(:email) } user.login {|u| u.email } user.password 'password' user.password_confirmation 'password' end
  • 34. Given quot;I am logged inquot; do user = Factory(:user) visits new_session_path fills_in 'Login', :with => user.login fills_in 'Password', :with => user.password clicks_button 'Login' end we b rat
  • 35. When == Change When quot;I create a new company named $namequot; do |name| visits new_company_path fills_in 'Name', :with => name clicks_button 'Create' end
  • 36. When == Change v a r i a ble When quot;I create a new company named $namequot; do |name| visits new_company_path fills_in 'Name', :with => name clicks_button 'Create' end When I create a new company named Acme
  • 37. Then == Outcome Then quot;I should see that a company named $name existsquot; do |name| response.body.should =~ Regexp.new(name) end
  • 38. Feature: Manage companies In order to keep track of companies A user Should be able to manage companies Scenario: Create a new company Given I am logged in When I create a new company named Acme Then I should see that a company named Acme exists 3 steps passsed
  • 39. Scenario: Paging through leads and rejecting Given a company called Apple Corp. And a company called Pear Inc. And a list for Client A And Apple Corp. is a new lead in a list for Client A And Pear Inc. is a new lead in a list for Client A And I am logged in as a staff member When I view the company overview for Apple Corp. And I reject Apple Corp. And I go to the next lead Then I see the company overview for Pear Inc.
  • 43. Feature: Cucumber In order to share the love As a presenter I will demonstrate behavior driven development with Cucumber Scenario: Behavior Driven Development with Cucumber Given a desire for higher quality software And a tool that executes feature documentation written in plain text When you watch this presentation Then you will gain an understanding of behavior driven development And see examples of behavior driven development with cucumber And be equipped to integrate Cucumber into your development process 6 steps passed
  • 44. @bkeepers github.com/ brandon collectiveidea opensoul.org sessions.collectiveidea.com