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

Behavior Driven Development
Behavior Driven DevelopmentBehavior Driven Development
Behavior Driven DevelopmentLiz Keogh
 
Test Automation Framework using Cucumber BDD overview (part 1)
Test Automation Framework using Cucumber BDD overview (part 1)Test Automation Framework using Cucumber BDD overview (part 1)
Test Automation Framework using Cucumber BDD overview (part 1)Mindfire Solutions
 
An introduction to Behavior-Driven Development (BDD)
An introduction to Behavior-Driven Development (BDD)An introduction to Behavior-Driven Development (BDD)
An introduction to Behavior-Driven Development (BDD)Suman Guha
 
Introduction to Bdd and cucumber
Introduction to Bdd and cucumberIntroduction to Bdd and cucumber
Introduction to Bdd and cucumberNibu Baby
 
BDD WITH CUCUMBER AND JAVA
BDD WITH CUCUMBER AND JAVABDD WITH CUCUMBER AND JAVA
BDD WITH CUCUMBER AND JAVASrinivas Katakam
 
Behavior driven development (bdd)
Behavior driven development (bdd)Behavior driven development (bdd)
Behavior driven development (bdd)Rohit Bisht
 
Behavior Driven Development and Automation Testing Using Cucumber
Behavior Driven Development and Automation Testing Using CucumberBehavior Driven Development and Automation Testing Using Cucumber
Behavior Driven Development and Automation Testing Using CucumberKMS Technology
 
Specification-By-Example with Gherkin
Specification-By-Example with GherkinSpecification-By-Example with Gherkin
Specification-By-Example with GherkinChristian Hassa
 
Specifications for the real world — Using Specification by Example and Gherkin
Specifications for the real world — Using Specification by Example and GherkinSpecifications for the real world — Using Specification by Example and Gherkin
Specifications for the real world — Using Specification by Example and GherkinKamil Nicieja
 
Test and Behaviour Driven Development (TDD/BDD)
Test and Behaviour Driven Development (TDD/BDD)Test and Behaviour Driven Development (TDD/BDD)
Test and Behaviour Driven Development (TDD/BDD)Lars Thorup
 
RxJS - The Basics & The Future
RxJS - The Basics & The FutureRxJS - The Basics & The Future
RxJS - The Basics & The FutureTracy Lee
 
Introducing BDD and TDD with Cucumber
Introducing BDD and TDD with CucumberIntroducing BDD and TDD with Cucumber
Introducing BDD and TDD with CucumberKnoldus Inc.
 
Crushed by technical debt
Crushed by technical debtCrushed by technical debt
Crushed by technical debtScott W. Ambler
 
Behavior Driven Development Pros and Cons
Behavior Driven Development Pros and ConsBehavior Driven Development Pros and Cons
Behavior Driven Development Pros and ConsIosif Itkin
 

What's hot (20)

Behavior Driven Development
Behavior Driven DevelopmentBehavior Driven Development
Behavior Driven Development
 
Gherkin /BDD intro
Gherkin /BDD introGherkin /BDD intro
Gherkin /BDD intro
 
BDD & Cucumber
BDD & CucumberBDD & Cucumber
BDD & Cucumber
 
Cucumber & gherkin language
Cucumber & gherkin languageCucumber & gherkin language
Cucumber & gherkin language
 
Test Automation Framework using Cucumber BDD overview (part 1)
Test Automation Framework using Cucumber BDD overview (part 1)Test Automation Framework using Cucumber BDD overview (part 1)
Test Automation Framework using Cucumber BDD overview (part 1)
 
An introduction to Behavior-Driven Development (BDD)
An introduction to Behavior-Driven Development (BDD)An introduction to Behavior-Driven Development (BDD)
An introduction to Behavior-Driven Development (BDD)
 
Test Automation Framework with BDD and Cucumber
Test Automation Framework with BDD and CucumberTest Automation Framework with BDD and Cucumber
Test Automation Framework with BDD and Cucumber
 
Cucumber BDD
Cucumber BDDCucumber BDD
Cucumber BDD
 
Introduction to Bdd and cucumber
Introduction to Bdd and cucumberIntroduction to Bdd and cucumber
Introduction to Bdd and cucumber
 
BDD WITH CUCUMBER AND JAVA
BDD WITH CUCUMBER AND JAVABDD WITH CUCUMBER AND JAVA
BDD WITH CUCUMBER AND JAVA
 
Behavior driven development (bdd)
Behavior driven development (bdd)Behavior driven development (bdd)
Behavior driven development (bdd)
 
Behavior Driven Development and Automation Testing Using Cucumber
Behavior Driven Development and Automation Testing Using CucumberBehavior Driven Development and Automation Testing Using Cucumber
Behavior Driven Development and Automation Testing Using Cucumber
 
Specification-By-Example with Gherkin
Specification-By-Example with GherkinSpecification-By-Example with Gherkin
Specification-By-Example with Gherkin
 
Bdd and spec flow
Bdd and spec flowBdd and spec flow
Bdd and spec flow
 
Specifications for the real world — Using Specification by Example and Gherkin
Specifications for the real world — Using Specification by Example and GherkinSpecifications for the real world — Using Specification by Example and Gherkin
Specifications for the real world — Using Specification by Example and Gherkin
 
Test and Behaviour Driven Development (TDD/BDD)
Test and Behaviour Driven Development (TDD/BDD)Test and Behaviour Driven Development (TDD/BDD)
Test and Behaviour Driven Development (TDD/BDD)
 
RxJS - The Basics & The Future
RxJS - The Basics & The FutureRxJS - The Basics & The Future
RxJS - The Basics & The Future
 
Introducing BDD and TDD with Cucumber
Introducing BDD and TDD with CucumberIntroducing BDD and TDD with Cucumber
Introducing BDD and TDD with Cucumber
 
Crushed by technical debt
Crushed by technical debtCrushed by technical debt
Crushed by technical debt
 
Behavior Driven Development Pros and Cons
Behavior Driven Development Pros and ConsBehavior Driven Development Pros and Cons
Behavior Driven Development Pros and Cons
 

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

SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 

Recently uploaded (20)

SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 

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