Cucumber and BDD <ul><li>Nashville Ruby on Rails meetup November 19, 2009 Josh Crews </li></ul>
Behavior Driven Development (BDD) <ul><li>first: describe what the software does </li></ul><ul><li>second: write the code ...
BDD <ul><li>Separate software design (one job) </li></ul><ul><li>from </li></ul><ul><li>writing code (a different job) </l...
BDD - design example Given I am a bureau owner  When I go to the homepage  And I am logged in  When I go to the speakers p...
Cucumber <ul><li>software for BDD  </li></ul><ul><li>that takes plain english, </li></ul><ul><li>Ruby translations of plai...
Cucumber - step definition Given /^I am a bureau owner$/ do  bureau = Factory(:bureau, :name => &quot;Steve's speakers&quo...
Cucumber’s sidekick: webrat <ul><li>Cucumber reads the story </li></ul><ul><li>Webrat  drives the browser </li></ul>When /...
Cucumber benefits <ul><li>Joy in programming </li></ul><ul><ul><li>clears the mind </li></ul></ul><ul><ul><li>controls fea...
Cucumber benefits <ul><li>Leaves a trail of feature-still-works guarantees </li></ul><ul><li>Easy re-factor with confidenc...
Cucumber setup <ul><li>http://cukes.info / </li></ul><ul><li>Railscasts #155, #159 </li></ul>
Cucumber: other <ul><li>Not a direct replacement for Test::Unit, Shoulda, Rspec </li></ul><ul><li>Cucumber can run integra...
Cucumber: Let’s use it! <ul><li>End of presentation--now to the terminal. </li></ul>
Upcoming SlideShare
Loading in …5
×

Cucumber And Bdd

3,498 views

Published on

Presentation on Behavior Driven Development and Cucumber for Rails developers given on 11/19/09 to Nashville Ruby on Rails meetup

Published in: Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
3,498
On SlideShare
0
From Embeds
0
Number of Embeds
108
Actions
Shares
0
Downloads
86
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Cucumber And Bdd

  1. 1. Cucumber and BDD <ul><li>Nashville Ruby on Rails meetup November 19, 2009 Josh Crews </li></ul>
  2. 2. Behavior Driven Development (BDD) <ul><li>first: describe what the software does </li></ul><ul><li>second: write the code to fulfill it </li></ul><ul><li>(behavior drives development) </li></ul>
  3. 3. BDD <ul><li>Separate software design (one job) </li></ul><ul><li>from </li></ul><ul><li>writing code (a different job) </li></ul>
  4. 4. BDD - design example Given I am a bureau owner When I go to the homepage And I am logged in When I go to the speakers page And I click on &quot;Add a speaker&quot; And I fill in &quot;speaker_name&quot; with &quot;Tad&quot; And I press &quot;Create profile&quot; Then I should see &quot;Tad&quot; And I should see &quot;Exclusive with Steve's speakers&quot;
  5. 5. Cucumber <ul><li>software for BDD </li></ul><ul><li>that takes plain english, </li></ul><ul><li>Ruby translations of plain english, </li></ul><ul><li>and runs integration test/stories against your application </li></ul>
  6. 6. Cucumber - step definition Given /^I am a bureau owner$/ do bureau = Factory(:bureau, :name => &quot;Steve's speakers&quot;) @user = Factory(:user, :bureau => bureau)end
  7. 7. Cucumber’s sidekick: webrat <ul><li>Cucumber reads the story </li></ul><ul><li>Webrat drives the browser </li></ul>When /^I go to (.+)$/ do |page_name| visit path_to(page_name) end end end
  8. 8. Cucumber benefits <ul><li>Joy in programming </li></ul><ul><ul><li>clears the mind </li></ul></ul><ul><ul><li>controls feature-drift </li></ul></ul><ul><ul><li>defines mini-milestones and git commits </li></ul></ul>
  9. 9. Cucumber benefits <ul><li>Leaves a trail of feature-still-works guarantees </li></ul><ul><li>Easy re-factor with confidence </li></ul>
  10. 10. Cucumber setup <ul><li>http://cukes.info / </li></ul><ul><li>Railscasts #155, #159 </li></ul>
  11. 11. Cucumber: other <ul><li>Not a direct replacement for Test::Unit, Shoulda, Rspec </li></ul><ul><li>Cucumber can run integration tests on any application (different languages or frameworks) </li></ul>
  12. 12. Cucumber: Let’s use it! <ul><li>End of presentation--now to the terminal. </li></ul>

×