S is for Spec

9,966 views

Published on

Bowling Game Kata live coding w/ RSpec in Ruby.

Published in: Technology
1 Comment
13 Likes
Statistics
Notes
No Downloads
Views
Total views
9,966
On SlideShare
0
From Embeds
0
Number of Embeds
1,235
Actions
Shares
0
Downloads
153
Comments
1
Likes
13
Embeds 0
No embeds

No notes for slide

S is for Spec

  1. 1. “S is for Spec”:Test Driven Development w/ RSpec KAKUTANI Shintaro; Eiwa System Management,Inc.; Nihon Ruby-no-kai
  2. 2. ✓ ✓ ✓ ✓ http://kakutani.com
  3. 3. RubyKaigi2008 http://jp.rubyist.net/RubyKaigi2008/
  4. 4. Red, Green, Refactoring TEST CLUB
  5. 5. Red, Green, Refactoring TEST CLUB
  6. 6. ✓ ✓ ✓ ✓
  7. 7. ✓ ✓ ✓ ✓ ✓ ✓ ✓
  8. 8. Clean code that works, in Ron Jeffries’ pithy phrase, is the goal of Test-Driven Development(TDD).
  9. 9. “Clean code that works”
  10. 10. “The translation of a feeling into a test is a common theme of TDD.”
  11. 11. ✓ ✓ ✓ ✓ ✓ ✓
  12. 12. http://www.biwa.ne.jp/~mmura/SoftwareDevelopment/WhatIsSoftwareDesignJ.html
  13. 13. ✓ ✓
  14. 14. ✓ ✓ ✓ ✓ ✓ ✓
  15. 15. ✓ ✓ ✓ ✓ ✓ ✓
  16. 16. ✓ ✓ ✓ ✓ ✓ ✓
  17. 17. Refactoring GREEN E D R
  18. 18. ✓ ✓ ✓ ✓ ✓ ✓
  19. 19. RED GREEN Refactoring
  20. 20. The Art of Agile Development
  21. 21. Think RED GREEN Refactoring
  22. 22. ✓ ✓ ✓ ✓ ✓ ✓ ✓
  23. 23. ✓ ✓ ✓ ✓
  24. 24. ✓ ✓
  25. 25. http://jp.rubyist.net/magazine/?0021-Rspec
  26. 26. describe Class, quot; quot; do before(:each) do # end it quot; quot; do # end end
  27. 27. describe Array, quot;with some entriesquot; do before(:each) do @array = %w(A B C) end it quot;should not be nilquot; do @array.should_not be_nil end it quot;should last element is 'C'quot; do @array.last.should == 'C' end end
  28. 28. spec -c array_spec.rb
  29. 29. ✓ @array.last.should == 'C' # @array.last 'C' ✓ @array.should_not be_nil # @array.nil? false
  30. 30. ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
  31. 31. http://jp.rubyist.net/magazine/?0021-Rspec
  32. 32. The Bowling Game Kata by Robert C.Martin(Uncle Bob) Bowling Game Kata Object Mentor, Inc. www.objectmentor.com blog.objectmentor.com fitnesse.org www.junit.org Copyright 2005 by Object Mentor, Inc All copies must retain this page unchanged. http://butunclebob.com/ArticleS.UncleBob.TheBowlingGameKata
  33. 33. http://codekata.pragprog.com/
  34. 34. ✓ ✓ ✓ ✓ http://codekata.pragprog.com/
  35. 35. ✓ ✓ ✓ ✓ ✓
  36. 36. ✓ ✓
  37. 37. 1 4 4 5 6 5 0 1 7 6 2 6 5 14 29 49 60 61 77 97 117 133 1,4,4,5,6,4,5,5, 10, 0,1,7,3,6,4,10,2,8,6
  38. 38. ✓ ✓ ✓ ✓ ✓ ✓
  39. 39. ✓ ✓ ✓ ✓
  40. 40. Tyler Durden says... use Rspec.

×