Behavior Driven Development with Cucumber

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

2 comments

Comments 1 - 2 of 2 previous next Post a comment

  • + toblakai toblakai 6 months ago
    Brilliant.
  • + guest75c716 guest75c716 8 months ago
    Nice slideshow. Interesting proposition, if a bit terse. Got me interested in trying it out for real, though.
Post a comment
Embed Video
Edit your comment Cancel

16 Favorites

Behavior Driven Development with Cucumber - Presentation Transcript

  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
  3. Quality
  4. 1 Quality meets requirements
  5. Developer Language Client
  6. Developer Stories Client
  7. 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
  8. 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
  9. 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
  10. 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
  11. 2 Quality works as expected
  12. Test Driven
  13. Behavior Driven
  14. Verify
  15. Confidence
  16. Design
  17. Behavior
  18. Testing Specifying
  19. Cucumber http://flickr.com/photos/nickatkins/527421404/
  20. rbehave rSpec Story Runner Cucumber
  21. http://github.com/aslakhellesoy/cucumber
  22. $ gem install cucumber
  23. Rakefile require 'rubygems' require 'cucumber/rake/task' Cucumber::Rake::Task.new
  24. $ rake features
  25. 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
  26. Dependencies $ gem install term-ansicolor \\ treetop diff-lcs hpricot
  27. $ ruby script/generate cucumber
  28. 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
  29. features/ companies.feature steps/ company_steps.rb
  30. 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
  31. Given \"I am logged in\" 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| \"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
  32. 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 we b rat
  33. 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
  34. When == Change v a r i a ble When \"I create a new company named $name\" do |name| visits new_company_path fills_in 'Name', :with => name clicks_button 'Create' end When I create a new company named Acme
  35. Then == Outcome Then \"I should see that a company named $name exists\" do |name| response.body.should =~ Regexp.new(name) end
  36. 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
  37. 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.
  38. Cucumber or RSpec?
  39. Cucumber or RSpec? BOTH
  40. http://github.com/bmabey/cucumber-tmbundle/
  41. 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
  42. @bkeepers github.com/ brandon collectiveidea opensoul.org sessions.collectiveidea.com

+ Brandon KeepersBrandon Keepers, 2 years ago

custom

8748 views, 16 favs, 2 embeds more stats

More info about this document

© All Rights Reserved

Go to text version

  • Total Views 8748
    • 8729 on SlideShare
    • 19 from embeds
  • Comments 2
  • Favorites 16
  • Downloads 275
Most viewed embeds
  • 17 views on http://blog.webintellix.com
  • 2 views on http://127.0.0.1:9999

more

All embeds
  • 17 views on http://blog.webintellix.com
  • 2 views on http://127.0.0.1:9999

less

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

Cancel
File a copyright complaint
Having problems? Go to our helpdesk?

Categories