Your SlideShare is downloading. ×
0
Behavior Driven Development with Cucumber
Behavior Driven Development with Cucumber
Behavior Driven Development with Cucumber
Behavior Driven Development with Cucumber
Behavior Driven Development with Cucumber
Behavior Driven Development with Cucumber
Behavior Driven Development with Cucumber
Behavior Driven Development with Cucumber
Behavior Driven Development with Cucumber
Behavior Driven Development with Cucumber
Behavior Driven Development with Cucumber
Behavior Driven Development with Cucumber
Behavior Driven Development with Cucumber
Behavior Driven Development with Cucumber
Behavior Driven Development with Cucumber
Behavior Driven Development with Cucumber
Behavior Driven Development with Cucumber
Behavior Driven Development with Cucumber
Behavior Driven Development with Cucumber
Behavior Driven Development with Cucumber
Behavior Driven Development with Cucumber
Behavior Driven Development with Cucumber
Behavior Driven Development with Cucumber
Behavior Driven Development with Cucumber
Behavior Driven Development with Cucumber
Behavior Driven Development with Cucumber
Behavior Driven Development with Cucumber
Behavior Driven Development with Cucumber
Behavior Driven Development with Cucumber
Behavior Driven Development with Cucumber
Behavior Driven Development with Cucumber
Behavior Driven Development with Cucumber
Behavior Driven Development with Cucumber
Behavior Driven Development with Cucumber
Behavior Driven Development with Cucumber
Behavior Driven Development with Cucumber
Behavior Driven Development with Cucumber
Behavior Driven Development with Cucumber
Behavior Driven Development with Cucumber
Behavior Driven Development with Cucumber
Behavior Driven Development with Cucumber
Behavior Driven Development with Cucumber
Behavior Driven Development with Cucumber
Behavior Driven Development with Cucumber
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Behavior Driven Development with Cucumber

39,740

Published on

Published in: Technology
4 Comments
63 Likes
Statistics
Notes
No Downloads
Views
Total Views
39,740
On Slideshare
0
From Embeds
0
Number of Embeds
15
Actions
Shares
0
Downloads
1,188
Comments
4
Likes
63
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

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 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
  • 31. 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
  • 32. 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
  • 33. 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
  • 34. 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
  • 35. Then == Outcome Then quot;I should see that a company named $name existsquot; 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

×