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 testing with cucumber
BDD testing with cucumberBDD testing with cucumber
BDD testing with cucumberDaniel Kummer
 
Introduction to BDD
Introduction to BDDIntroduction to BDD
Introduction to BDDKnoldus Inc.
 
Introduction to Bdd and cucumber
Introduction to Bdd and cucumberIntroduction to Bdd and cucumber
Introduction to Bdd and cucumberNibu Baby
 
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 Is Cucumber?
What Is Cucumber?What Is Cucumber?
What Is Cucumber?QATestLab
 
Behavior driven development (bdd)
Behavior driven development (bdd)Behavior driven development (bdd)
Behavior driven development (bdd)Rohit Bisht
 
Bdd – with cucumber and gherkin
Bdd – with cucumber and gherkinBdd – with cucumber and gherkin
Bdd – with cucumber and gherkinArati Joshi
 
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
 
Test Automation and Selenium
Test Automation and SeleniumTest Automation and Selenium
Test Automation and SeleniumKarapet Sarkisyan
 
Pipeline based deployments on Jenkins
Pipeline based deployments  on JenkinsPipeline based deployments  on Jenkins
Pipeline based deployments on JenkinsKnoldus Inc.
 
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.
 
Test automation with Cucumber-JVM
Test automation with Cucumber-JVMTest automation with Cucumber-JVM
Test automation with Cucumber-JVMAlan Parkinson
 

What's hot (20)

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
 
BDD testing with cucumber
BDD testing with cucumberBDD testing with cucumber
BDD testing with cucumber
 
Introduction to BDD
Introduction to BDDIntroduction to BDD
Introduction to BDD
 
Introduction to Bdd and cucumber
Introduction to Bdd and cucumberIntroduction to Bdd and cucumber
Introduction to Bdd and cucumber
 
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
 
BDD for APIs
BDD for APIsBDD for APIs
BDD for APIs
 
What Is Cucumber?
What Is Cucumber?What Is Cucumber?
What Is Cucumber?
 
BDD & Cucumber
BDD & CucumberBDD & Cucumber
BDD & Cucumber
 
Cucumber BDD
Cucumber BDDCucumber BDD
Cucumber BDD
 
Behavior driven development (bdd)
Behavior driven development (bdd)Behavior driven development (bdd)
Behavior driven development (bdd)
 
BDD and Behave
BDD and BehaveBDD and Behave
BDD and Behave
 
Bdd – with cucumber and gherkin
Bdd – with cucumber and gherkinBdd – with cucumber and gherkin
Bdd – with cucumber and gherkin
 
Cucumber presenation
Cucumber presenationCucumber presenation
Cucumber presenation
 
Behavior Driven Development Testing (BDD)
Behavior Driven Development Testing (BDD)Behavior Driven Development Testing (BDD)
Behavior Driven Development Testing (BDD)
 
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)
 
Test Automation and Selenium
Test Automation and SeleniumTest Automation and Selenium
Test Automation and Selenium
 
Pipeline based deployments on Jenkins
Pipeline based deployments  on JenkinsPipeline based deployments  on Jenkins
Pipeline based deployments on Jenkins
 
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
 
Selenium with Cucumber
Selenium  with Cucumber Selenium  with Cucumber
Selenium with Cucumber
 
Test automation with Cucumber-JVM
Test automation with Cucumber-JVMTest automation with Cucumber-JVM
Test automation with Cucumber-JVM
 

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

"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
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
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
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
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
 
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
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
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
 

Recently uploaded (20)

"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
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
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
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
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.
 
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
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
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
 

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