SlideShare a Scribd company logo
1 of 15
Behavior Driven DevelopmentSDXP/SDRuby 10,000 Foot Overview
Presentation Notes Don’t bother to pound this into your laptops The whole thing is on: http://calicowebdev.com/tblog There are some of my older blog posts about rSpec on: http://calicowebdev.com/blog
Who The Hell Am I? I’d be asking the same question Since you asked (or not), Steve Ross (@cwd1) Calico Web Development, I build Web apps using primarily Ruby, rSpec, Cucumber and a bunch of other keen Ruby technologies like … um … Rails, Haml, Sass OSS for last 10 years. Ruby/Rails since 2005 Still trying to get it right … or better
Not Me… But when I’m not programming, this would be a good place to be, right?
Yikes! I have way more to talk about than I have time to talk. Big surprise.
Behavior Driven Development BDD is a way of expressing a set of expected results – i.e., tests. That is as opposed to TDD (test, blah) where you express what you think happened and check to see that it did.
Let’s See Some Side By Side Be patient. We’ll get to the real code.
Tools I Use Ruby rSpec / rspec-rails Cucumber Faker Fixjour Again, all this stuff is on:http://calicowebdev.com/tblog
Behavior vs. Test-Driven Development TDD Way  def test_foo_is_seven    assert_equal(7, @foo)  end BDD Way describe @foo do    it "should be seven" do      @foo.should == 7    end  end
TDD vs BDD (Gratuitous Picture) TDD: assert(true, @surfers.last.hit?) BDD: @surfers.last.shouldbe_hit
The Premise: Readability of specs is better than “tests” Writability of specs is more natural It’s more likely that you will spec first
The Flow My personal work habits Bounce around between Cucumber and rSpec Create failing Scenario/Spec, then code to fix Build coverage and edge case handling as I can Try not to be too obsessive :)
Cucumber: In One Sentence Story-based description of behaviors Divides specification into Feature > Scenario Tests from way outside, ignoring internals Not as focused as unit/functional tests Easier to miss edge cases Slower Killer for covering full stacks like Rails
I Lied. Another Sentence Feature: Stopping a Car     In order to stop my car when I need to     As a driver     I want the brakes always to bring the car to a halt     Scenario: Stopping under normal circumstances       Given The ignition is on       And The car is in motion       When I step on the brake       Then I should stop     Scenario: Stopping when the accelerator is also depressed       Given The ignition is on       And The accelerator is also depressed       When I step on the brake       Then I should stop     Scenario: Stopping when the accelerator is stuck       Given The ignition is on       And The accelerator is stuck       When I step on the brake       Then I should stop
The Obligatory Rails Blog Developing from the outside in First do a bit of plumbing Next write features Code to make them pass Drill down to specs where necessary Eventually, you want good coverage both at acceptance (Cuke) and spec level

More Related Content

What's hot

0514 matthew 57 blessed are the merciful power point church sermon
0514 matthew 57 blessed are the merciful power point church sermon0514 matthew 57 blessed are the merciful power point church sermon
0514 matthew 57 blessed are the merciful power point church sermon
PowerPoint_Sermons
 

What's hot (9)

Wp snapper review
Wp snapper reviewWp snapper review
Wp snapper review
 
Merb Core
Merb CoreMerb Core
Merb Core
 
Aw galleries!
Aw galleries!Aw galleries!
Aw galleries!
 
Multi Modal Voice Development with Amazon Alexa
Multi Modal Voice Development with Amazon AlexaMulti Modal Voice Development with Amazon Alexa
Multi Modal Voice Development with Amazon Alexa
 
Symfony Admin Generator
Symfony Admin GeneratorSymfony Admin Generator
Symfony Admin Generator
 
JavaScript Debugging Tips and Tricks
JavaScript Debugging Tips and TricksJavaScript Debugging Tips and Tricks
JavaScript Debugging Tips and Tricks
 
AgileTD: Learning through osmosis
AgileTD: Learning through osmosisAgileTD: Learning through osmosis
AgileTD: Learning through osmosis
 
0514 matthew 57 blessed are the merciful power point church sermon
0514 matthew 57 blessed are the merciful power point church sermon0514 matthew 57 blessed are the merciful power point church sermon
0514 matthew 57 blessed are the merciful power point church sermon
 
AgileTD: Mob testing Training Day
AgileTD: Mob testing Training DayAgileTD: Mob testing Training Day
AgileTD: Mob testing Training Day
 

Similar to SD Ruby BDD Talk

Cucumber Presentation Kiev Meet Up
Cucumber Presentation Kiev Meet UpCucumber Presentation Kiev Meet Up
Cucumber Presentation Kiev Meet Up
dimakovalenko
 
Culture And Aesthetic Revisited
Culture And Aesthetic RevisitedCulture And Aesthetic Revisited
Culture And Aesthetic Revisited
Adam Keys
 
It's OK to make a new folder within Rails.
It's OK to make a new folder within Rails.It's OK to make a new folder within Rails.
It's OK to make a new folder within Rails.
cschaafsma
 

Similar to SD Ruby BDD Talk (20)

Cucumber Presentation Kiev Meet Up
Cucumber Presentation Kiev Meet UpCucumber Presentation Kiev Meet Up
Cucumber Presentation Kiev Meet Up
 
Selenium and Cucumber Selenium Conf 2011
Selenium and Cucumber Selenium Conf 2011Selenium and Cucumber Selenium Conf 2011
Selenium and Cucumber Selenium Conf 2011
 
Graceful Failure with Selenium and Continuous Integration
Graceful Failure with Selenium and Continuous IntegrationGraceful Failure with Selenium and Continuous Integration
Graceful Failure with Selenium and Continuous Integration
 
BDD with SpecFlow and Selenium
BDD with SpecFlow and SeleniumBDD with SpecFlow and Selenium
BDD with SpecFlow and Selenium
 
Agile JavaScript Testing
Agile JavaScript TestingAgile JavaScript Testing
Agile JavaScript Testing
 
How to implement ruby on rails testing practices to build a successful web ap...
How to implement ruby on rails testing practices to build a successful web ap...How to implement ruby on rails testing practices to build a successful web ap...
How to implement ruby on rails testing practices to build a successful web ap...
 
Handling Non Functional Requirements on an Agile Project
Handling Non Functional Requirements on an Agile ProjectHandling Non Functional Requirements on an Agile Project
Handling Non Functional Requirements on an Agile Project
 
Culture And Aesthetic Revisited
Culture And Aesthetic RevisitedCulture And Aesthetic Revisited
Culture And Aesthetic Revisited
 
It's OK to make a new folder within Rails.
It's OK to make a new folder within Rails.It's OK to make a new folder within Rails.
It's OK to make a new folder within Rails.
 
Rails Vs CakePHP
Rails Vs CakePHPRails Vs CakePHP
Rails Vs CakePHP
 
Intro to Rails
Intro to RailsIntro to Rails
Intro to Rails
 
Ruby on Rails from the other side of the tracks
Ruby on Rails from the other side of the tracksRuby on Rails from the other side of the tracks
Ruby on Rails from the other side of the tracks
 
What rails taught me – Eugene Pirogov
What rails taught me – Eugene PirogovWhat rails taught me – Eugene Pirogov
What rails taught me – Eugene Pirogov
 
Js basics
Js basicsJs basics
Js basics
 
Rails Development That Doesn't Hurt
Rails Development That Doesn't HurtRails Development That Doesn't Hurt
Rails Development That Doesn't Hurt
 
Single Page Apps - Gerry White @ BrightonSEO
Single Page Apps - Gerry White @ BrightonSEOSingle Page Apps - Gerry White @ BrightonSEO
Single Page Apps - Gerry White @ BrightonSEO
 
CUCUMBER - Making BDD Fun
CUCUMBER - Making BDD FunCUCUMBER - Making BDD Fun
CUCUMBER - Making BDD Fun
 
Behat - human-readable automated testing
Behat - human-readable automated testingBehat - human-readable automated testing
Behat - human-readable automated testing
 
Getting Answers to Your Testing Questions
Getting Answers to Your Testing QuestionsGetting Answers to Your Testing Questions
Getting Answers to Your Testing Questions
 
Frontend Performance: Illusions & browser rendering
Frontend Performance: Illusions & browser renderingFrontend Performance: Illusions & browser rendering
Frontend Performance: Illusions & browser rendering
 

Recently uploaded

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Recently uploaded (20)

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
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
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
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
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
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 

SD Ruby BDD Talk

  • 2. Presentation Notes Don’t bother to pound this into your laptops The whole thing is on: http://calicowebdev.com/tblog There are some of my older blog posts about rSpec on: http://calicowebdev.com/blog
  • 3. Who The Hell Am I? I’d be asking the same question Since you asked (or not), Steve Ross (@cwd1) Calico Web Development, I build Web apps using primarily Ruby, rSpec, Cucumber and a bunch of other keen Ruby technologies like … um … Rails, Haml, Sass OSS for last 10 years. Ruby/Rails since 2005 Still trying to get it right … or better
  • 4. Not Me… But when I’m not programming, this would be a good place to be, right?
  • 5. Yikes! I have way more to talk about than I have time to talk. Big surprise.
  • 6. Behavior Driven Development BDD is a way of expressing a set of expected results – i.e., tests. That is as opposed to TDD (test, blah) where you express what you think happened and check to see that it did.
  • 7. Let’s See Some Side By Side Be patient. We’ll get to the real code.
  • 8. Tools I Use Ruby rSpec / rspec-rails Cucumber Faker Fixjour Again, all this stuff is on:http://calicowebdev.com/tblog
  • 9. Behavior vs. Test-Driven Development TDD Way def test_foo_is_seven assert_equal(7, @foo) end BDD Way describe @foo do it "should be seven" do @foo.should == 7 end end
  • 10. TDD vs BDD (Gratuitous Picture) TDD: assert(true, @surfers.last.hit?) BDD: @surfers.last.shouldbe_hit
  • 11. The Premise: Readability of specs is better than “tests” Writability of specs is more natural It’s more likely that you will spec first
  • 12. The Flow My personal work habits Bounce around between Cucumber and rSpec Create failing Scenario/Spec, then code to fix Build coverage and edge case handling as I can Try not to be too obsessive :)
  • 13. Cucumber: In One Sentence Story-based description of behaviors Divides specification into Feature > Scenario Tests from way outside, ignoring internals Not as focused as unit/functional tests Easier to miss edge cases Slower Killer for covering full stacks like Rails
  • 14. I Lied. Another Sentence Feature: Stopping a Car In order to stop my car when I need to As a driver I want the brakes always to bring the car to a halt Scenario: Stopping under normal circumstances Given The ignition is on And The car is in motion When I step on the brake Then I should stop Scenario: Stopping when the accelerator is also depressed Given The ignition is on And The accelerator is also depressed When I step on the brake Then I should stop Scenario: Stopping when the accelerator is stuck Given The ignition is on And The accelerator is stuck When I step on the brake Then I should stop
  • 15. The Obligatory Rails Blog Developing from the outside in First do a bit of plumbing Next write features Code to make them pass Drill down to specs where necessary Eventually, you want good coverage both at acceptance (Cuke) and spec level