SlideShare a Scribd company logo
1 of 40
Download to read offline
Frank Duan
Kinesis
2010
 Introduction to BDD
 Introduction to Cucumber
 Stories and Cucumber features
 Building Cucumber Scenarios and Steps
 Tools
 Slicing Cucumber
 Cucumber Catalyst
FAIL
“I believe that the hardest part of software projects, the
most common source of project failure, is
communication with the customers and users of that
software.
By providing a clear yet precise language to deal with
domains, a DSL can help improve this
communication.”
Martin Fowler
 To meet requirement
 To guarantee quality
verify confidence Design Behaviour
GAP
 Outside-In
 Feature
 Scenario
Scenario: title
Given [Context]
And [More Context]
When [Action]
And [Other Action]
Then [Expected Outcome]
But [Unexpected Outcome]
 A story
 Token for Conversation
 Meet Gherkin
Scenario: search by director
Given the store has movies directed by “Steven
Spielberg”
When I search for “Steven Spielberg”
Then I should see all of the movies directed by “Steven
Spielberg”
 Meet Advanced Gherkin –TABLE
Scenario: search by director
Given the following movies are in stock:
| Title | Director | Year |
| Jaws | Steven Spielberg | 1975 |
| Star Wars | George Lucas | 1975 |
| Dawn of the Dead | George Romero | 1978 |
| E.T. | Steven Spielberg | 1982 |
When I search for "Spielberg" under "Director"
Then I should see the following table:
| Title | Director | Year |
| Jaws | Steven Spielberg | 1975 |
| E.T. | Steven Spielberg | 1982 |
 Meet Advanced Gherkin –Multi-Line String
Scenario: register successfully
Given I am on on the registration page
When I sign up as "Jojo Binks"
Then I should receive the following email:
"""
Thanks for signing up Jojo!
Important information about here.
"""
 Meet Advanced Gherkin –Scenario Outlines
Scenario Outline: search by director
Given the following movies are in stock:
| Title | Director | Year |
| Jaws | Steven Spielberg | 1975 |
| Star Wars | George Lucas | 1975 |
| Dawn of the Dead | George Romero | 1978 |
| E.T. | Steven Spielberg | 1982 |
When I search for "<Director Query>" under "Director"
Then I the search results should be "<Search Results>"
Examples:
| Director Query | Search Results |
| Steve | E.T., Jaws |
| George | Dawn of the Dead, Star Wars |
| Lucas | Star Wars |
 Building step definition (Example)
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
 Building step definition – Given
 Given == Setup
Given "I am logged in" do
user = Factory(:user)
visits new_session_path
fills_in ‘Login’, :with => user.login
fills_in ‘Password’, :with => user.password
clicks_button ‘Login’
end
 Building step definition – When
 When == Change
When "I create a new company named $name" do
|name|
visits new_company_path
fills_in 'Name', :with => name
clicks_button 'Create'
end
 Building step definition – Then
 Then == Outcome
Then "I should see that a company named $name exists"
do |name|
response.body.should =~ Regexp.new(name)
end
 Hooks – Before and After
 Generic hooks or hooks by tags
 Background
 Adpating rspec DSL for validation
 DOESN’T adpate rspec mock module
 Use factory_girl instead
 factory_girl: load data into database for test
Given "I am logged in" do
user = Factory(:user)
visits new_session_path
fills_in ‘Login’, :with => user.login
fills_in ‘Password’, :with =>
user.password
clicks_button ‘Login’
end Factory.sequence(:email) {|n| "user#{n}@example.com" }
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
 Simulating or drive Browsers
 Feature on Javascript test
 Flexibility on switching drivers to achieve different test
demand
 Flexibility on switching between css and xpath selector
 Covering most of the popular browser driving
 Remote calling (for IE test on VM)
 Highlight keywords in Gherkin
 Autocomplete by hotkey
 Run by hotkey and present visual report
 A DRb server for testing frameworks (RSpec /
Cucumber currently) that forks before each run to
ensure a clean testing state.
 Soren knows all about that : s
 Lazy coverage-aware running of Cucumber acceptance
tests
 Run a scenario if it needs to
 Distributed testing framework
 Spread your tests over processors and/or multiple
machines to test your code faster
 Don’t force structure
 Avoid Noise!
 Avoid Inconsistency
 Balance Abstraction
 Building step abstraction from steps
 Tagging
 Tagging for focused testing
 Tagging for categorizing test by purpose and environs
 Tagging for loading capybara configuration
 Slow builds are the enemy of continuous integration
 Reuse – Spork, Cucover
 Run Just Enough Tests
 Slicing Features with tags
 Just enough Database and try NullDB
 Distributed testing - hydra
 The Rspec Book
 http://www.slideshare.net/josephwilk/rocket-fuelled-
cucumbers
 http://www.slideshare.net/bkeepers/behavior-driven-
development-with-cucumber-presentation
 http://www.slideshare.net/josephwilk/cucumbered
 http://www.slideshare.net/bmabey/cucumber-
automating-the-requirements-language-you-already-
speak
Thanks for your patience

More Related Content

Similar to Bdd, cucumber and freinds

Javascript testing should be awesome
Javascript testing should be awesomeJavascript testing should be awesome
Javascript testing should be awesomeAbderrazak BOUADMA
 
I put on my mink and wizard behat
I put on my mink and wizard behatI put on my mink and wizard behat
I put on my mink and wizard behatxsist10
 
Software Testing
Software TestingSoftware Testing
Software Testingsuperphly
 
End to-end testing from rookie to pro
End to-end testing  from rookie to proEnd to-end testing  from rookie to pro
End to-end testing from rookie to proDomenico Gemoli
 
I put on my mink and wizard behat - Confoo Canada
I put on my mink and wizard behat - Confoo CanadaI put on my mink and wizard behat - Confoo Canada
I put on my mink and wizard behat - Confoo Canadaxsist10
 
David Nuescheler: Igniting CQ 5.3: What's New and Roadmap
David Nuescheler: Igniting CQ 5.3: What's New and RoadmapDavid Nuescheler: Igniting CQ 5.3: What's New and Roadmap
David Nuescheler: Igniting CQ 5.3: What's New and RoadmapDay Software
 
Continuous Deployment at Scale, Baltic DevOps 2016
Continuous Deployment at Scale, Baltic DevOps 2016Continuous Deployment at Scale, Baltic DevOps 2016
Continuous Deployment at Scale, Baltic DevOps 2016Premshree Pillai
 
One Click Provisioning With Enterprise Manager 12c
One Click Provisioning With Enterprise Manager 12cOne Click Provisioning With Enterprise Manager 12c
One Click Provisioning With Enterprise Manager 12cJosh Turner
 
Continuous Deployment at Scale, Rootconf 2016
Continuous Deployment at Scale, Rootconf 2016Continuous Deployment at Scale, Rootconf 2016
Continuous Deployment at Scale, Rootconf 2016Premshree Pillai
 
Paris Web - Javascript as a programming language
Paris Web - Javascript as a programming languageParis Web - Javascript as a programming language
Paris Web - Javascript as a programming languageMarco Cedaro
 
Continuous Deployment at Scale, PHPConfAsia 2016
Continuous Deployment at Scale, PHPConfAsia 2016Continuous Deployment at Scale, PHPConfAsia 2016
Continuous Deployment at Scale, PHPConfAsia 2016Premshree Pillai
 
Behavioral Driven Development
Behavioral Driven Development Behavioral Driven Development
Behavioral Driven Development Cprime
 
Automated Testing with Ruby
Automated Testing with RubyAutomated Testing with Ruby
Automated Testing with RubyKeith Pitty
 
Behavior Driven Development by Example
Behavior Driven Development by ExampleBehavior Driven Development by Example
Behavior Driven Development by ExampleNalin Goonawardana
 
Java script unit testing
Java script unit testingJava script unit testing
Java script unit testingMats Bryntse
 
Jozef Ve Providing Scalability for Pirates, Lizards and Zombies at #DOXLON
Jozef Ve Providing Scalability for Pirates, Lizards and Zombies at #DOXLONJozef Ve Providing Scalability for Pirates, Lizards and Zombies at #DOXLON
Jozef Ve Providing Scalability for Pirates, Lizards and Zombies at #DOXLONOutlyer
 
How EVERFI Moved from No Automation to Continuous Test Generation in 9 Months
How EVERFI Moved from No Automation to Continuous Test Generation in 9 MonthsHow EVERFI Moved from No Automation to Continuous Test Generation in 9 Months
How EVERFI Moved from No Automation to Continuous Test Generation in 9 MonthsApplitools
 

Similar to Bdd, cucumber and freinds (20)

Javascript testing should be awesome
Javascript testing should be awesomeJavascript testing should be awesome
Javascript testing should be awesome
 
I put on my mink and wizard behat
I put on my mink and wizard behatI put on my mink and wizard behat
I put on my mink and wizard behat
 
Software Testing
Software TestingSoftware Testing
Software Testing
 
End to-end testing from rookie to pro
End to-end testing  from rookie to proEnd to-end testing  from rookie to pro
End to-end testing from rookie to pro
 
I put on my mink and wizard behat - Confoo Canada
I put on my mink and wizard behat - Confoo CanadaI put on my mink and wizard behat - Confoo Canada
I put on my mink and wizard behat - Confoo Canada
 
David Nuescheler: Igniting CQ 5.3: What's New and Roadmap
David Nuescheler: Igniting CQ 5.3: What's New and RoadmapDavid Nuescheler: Igniting CQ 5.3: What's New and Roadmap
David Nuescheler: Igniting CQ 5.3: What's New and Roadmap
 
UI Testing
UI TestingUI Testing
UI Testing
 
Continuous Deployment at Scale, Baltic DevOps 2016
Continuous Deployment at Scale, Baltic DevOps 2016Continuous Deployment at Scale, Baltic DevOps 2016
Continuous Deployment at Scale, Baltic DevOps 2016
 
One Click Provisioning With Enterprise Manager 12c
One Click Provisioning With Enterprise Manager 12cOne Click Provisioning With Enterprise Manager 12c
One Click Provisioning With Enterprise Manager 12c
 
Continuous Deployment at Scale, Rootconf 2016
Continuous Deployment at Scale, Rootconf 2016Continuous Deployment at Scale, Rootconf 2016
Continuous Deployment at Scale, Rootconf 2016
 
Cucumber
Cucumber Cucumber
Cucumber
 
Paris Web - Javascript as a programming language
Paris Web - Javascript as a programming languageParis Web - Javascript as a programming language
Paris Web - Javascript as a programming language
 
Continuous Deployment at Scale, PHPConfAsia 2016
Continuous Deployment at Scale, PHPConfAsia 2016Continuous Deployment at Scale, PHPConfAsia 2016
Continuous Deployment at Scale, PHPConfAsia 2016
 
Behavioral Driven Development
Behavioral Driven Development Behavioral Driven Development
Behavioral Driven Development
 
Automated Testing with Ruby
Automated Testing with RubyAutomated Testing with Ruby
Automated Testing with Ruby
 
Behavior Driven Development by Example
Behavior Driven Development by ExampleBehavior Driven Development by Example
Behavior Driven Development by Example
 
Java script unit testing
Java script unit testingJava script unit testing
Java script unit testing
 
Jozef Ve Providing Scalability for Pirates, Lizards and Zombies at #DOXLON
Jozef Ve Providing Scalability for Pirates, Lizards and Zombies at #DOXLONJozef Ve Providing Scalability for Pirates, Lizards and Zombies at #DOXLON
Jozef Ve Providing Scalability for Pirates, Lizards and Zombies at #DOXLON
 
Drupal 7 ci and testing
Drupal 7 ci and testingDrupal 7 ci and testing
Drupal 7 ci and testing
 
How EVERFI Moved from No Automation to Continuous Test Generation in 9 Months
How EVERFI Moved from No Automation to Continuous Test Generation in 9 MonthsHow EVERFI Moved from No Automation to Continuous Test Generation in 9 Months
How EVERFI Moved from No Automation to Continuous Test Generation in 9 Months
 

Recently uploaded

DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxRemote DBA Services
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Zilliz
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...WSO2
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityWSO2
 
API Governance and Monetization - The evolution of API governance
API Governance and Monetization -  The evolution of API governanceAPI Governance and Monetization -  The evolution of API governance
API Governance and Monetization - The evolution of API governanceWSO2
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard37
 
Choreo: Empowering the Future of Enterprise Software Engineering
Choreo: Empowering the Future of Enterprise Software EngineeringChoreo: Empowering the Future of Enterprise Software Engineering
Choreo: Empowering the Future of Enterprise Software EngineeringWSO2
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
Quantum Leap in Next-Generation Computing
Quantum Leap in Next-Generation ComputingQuantum Leap in Next-Generation Computing
Quantum Leap in Next-Generation ComputingWSO2
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
Navigating Identity and Access Management in the Modern Enterprise
Navigating Identity and Access Management in the Modern EnterpriseNavigating Identity and Access Management in the Modern Enterprise
Navigating Identity and Access Management in the Modern EnterpriseWSO2
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 

Recently uploaded (20)

DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
API Governance and Monetization - The evolution of API governance
API Governance and Monetization -  The evolution of API governanceAPI Governance and Monetization -  The evolution of API governance
API Governance and Monetization - The evolution of API governance
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptx
 
Choreo: Empowering the Future of Enterprise Software Engineering
Choreo: Empowering the Future of Enterprise Software EngineeringChoreo: Empowering the Future of Enterprise Software Engineering
Choreo: Empowering the Future of Enterprise Software Engineering
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Quantum Leap in Next-Generation Computing
Quantum Leap in Next-Generation ComputingQuantum Leap in Next-Generation Computing
Quantum Leap in Next-Generation Computing
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Navigating Identity and Access Management in the Modern Enterprise
Navigating Identity and Access Management in the Modern EnterpriseNavigating Identity and Access Management in the Modern Enterprise
Navigating Identity and Access Management in the Modern Enterprise
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 

Bdd, cucumber and freinds

  • 2.  Introduction to BDD  Introduction to Cucumber  Stories and Cucumber features  Building Cucumber Scenarios and Steps  Tools  Slicing Cucumber  Cucumber Catalyst
  • 4. “I believe that the hardest part of software projects, the most common source of project failure, is communication with the customers and users of that software. By providing a clear yet precise language to deal with domains, a DSL can help improve this communication.” Martin Fowler
  • 5.  To meet requirement  To guarantee quality verify confidence Design Behaviour
  • 6. GAP
  • 7.
  • 9.
  • 10.
  • 11.
  • 13.
  • 14.  Scenario Scenario: title Given [Context] And [More Context] When [Action] And [Other Action] Then [Expected Outcome] But [Unexpected Outcome]
  • 15.
  • 17.  Token for Conversation
  • 19. Scenario: search by director Given the store has movies directed by “Steven Spielberg” When I search for “Steven Spielberg” Then I should see all of the movies directed by “Steven Spielberg”
  • 20.  Meet Advanced Gherkin –TABLE Scenario: search by director Given the following movies are in stock: | Title | Director | Year | | Jaws | Steven Spielberg | 1975 | | Star Wars | George Lucas | 1975 | | Dawn of the Dead | George Romero | 1978 | | E.T. | Steven Spielberg | 1982 | When I search for "Spielberg" under "Director" Then I should see the following table: | Title | Director | Year | | Jaws | Steven Spielberg | 1975 | | E.T. | Steven Spielberg | 1982 |
  • 21.  Meet Advanced Gherkin –Multi-Line String Scenario: register successfully Given I am on on the registration page When I sign up as "Jojo Binks" Then I should receive the following email: """ Thanks for signing up Jojo! Important information about here. """
  • 22.  Meet Advanced Gherkin –Scenario Outlines Scenario Outline: search by director Given the following movies are in stock: | Title | Director | Year | | Jaws | Steven Spielberg | 1975 | | Star Wars | George Lucas | 1975 | | Dawn of the Dead | George Romero | 1978 | | E.T. | Steven Spielberg | 1982 | When I search for "<Director Query>" under "Director" Then I the search results should be "<Search Results>" Examples: | Director Query | Search Results | | Steve | E.T., Jaws | | George | Dawn of the Dead, Star Wars | | Lucas | Star Wars |
  • 23.  Building step definition (Example) 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
  • 24.  Building step definition – Given  Given == Setup Given "I am logged in" do user = Factory(:user) visits new_session_path fills_in ‘Login’, :with => user.login fills_in ‘Password’, :with => user.password clicks_button ‘Login’ end
  • 25.  Building step definition – When  When == Change When "I create a new company named $name" do |name| visits new_company_path fills_in 'Name', :with => name clicks_button 'Create' end
  • 26.  Building step definition – Then  Then == Outcome Then "I should see that a company named $name exists" do |name| response.body.should =~ Regexp.new(name) end
  • 27.  Hooks – Before and After  Generic hooks or hooks by tags  Background
  • 28.  Adpating rspec DSL for validation  DOESN’T adpate rspec mock module  Use factory_girl instead
  • 29.  factory_girl: load data into database for test Given "I am logged in" do user = Factory(:user) visits new_session_path fills_in ‘Login’, :with => user.login fills_in ‘Password’, :with => user.password clicks_button ‘Login’ end Factory.sequence(:email) {|n| "user#{n}@example.com" } 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
  • 30.  Simulating or drive Browsers  Feature on Javascript test  Flexibility on switching drivers to achieve different test demand  Flexibility on switching between css and xpath selector  Covering most of the popular browser driving  Remote calling (for IE test on VM)
  • 31.  Highlight keywords in Gherkin  Autocomplete by hotkey  Run by hotkey and present visual report
  • 32.  A DRb server for testing frameworks (RSpec / Cucumber currently) that forks before each run to ensure a clean testing state.
  • 33.  Soren knows all about that : s
  • 34.  Lazy coverage-aware running of Cucumber acceptance tests  Run a scenario if it needs to
  • 35.  Distributed testing framework  Spread your tests over processors and/or multiple machines to test your code faster
  • 36.  Don’t force structure  Avoid Noise!  Avoid Inconsistency  Balance Abstraction
  • 37.  Building step abstraction from steps  Tagging  Tagging for focused testing  Tagging for categorizing test by purpose and environs  Tagging for loading capybara configuration
  • 38.  Slow builds are the enemy of continuous integration  Reuse – Spork, Cucover  Run Just Enough Tests  Slicing Features with tags  Just enough Database and try NullDB  Distributed testing - hydra
  • 39.  The Rspec Book  http://www.slideshare.net/josephwilk/rocket-fuelled- cucumbers  http://www.slideshare.net/bkeepers/behavior-driven- development-with-cucumber-presentation  http://www.slideshare.net/josephwilk/cucumbered  http://www.slideshare.net/bmabey/cucumber- automating-the-requirements-language-you-already- speak
  • 40. Thanks for your patience