Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Wicked Good Ruby 2013 - Killing Fibonacci

Dan Sharp
October 13, 2013

Wicked Good Ruby 2013 - Killing Fibonacci

Video of Presentation: http://confreaks.com/videos/2741-wickedgoodruby-killing-fibonacci

Testing is an important part of the development lifecycle of any software solution. It is particularly important in the Ruby community with lots of real and perceived pressure to test first, test often and test fully (or at least 90% coverage, right?). However, many Rubyists don't test... or don't test enough... or even worse: don't test well. I believe this is due, in large part, to a communal pressure to "be all about testing" but without some good, practical advice on how to do that... or even just how to get started with TDD. This presentation is a journey into the past... to guide and teach a fledgling TDDer 10 lessons on how to begin and succeed with TDD. The current me offers some much-needed counsel to an 8-years-ago version of me on how to approach TDD and begin to embrace it as a Good Thing™. I use the Fibonacci sequence as a backdrop of the lessons and how to build out a short application via TDD. Stay to the end, because there's a very interesting surprise in store!

Dan Sharp

October 13, 2013
Tweet

More Decks by Dan Sharp

Other Decks in Technology

Transcript

  1. Back to the Past Danny’05 gets a visit from Dan2013

    Photo credit: http://www.scififx.com/wp-content/uploads/2013/04/back-to-the-future-delorean.jpg
  2. The “Story” Suppose... it’s 2005... ! I work for InvestCorp

    and they want to improve their Stock Picker app. They heard about this "Retracement" thingy and something about Fibonacci as a way to figure out a predictor.
  3. The “Story” As the software developer for InvestCorp, I was

    told that I needed to build a predictor algorithm that would be used by some front-end calculation code. It needs to use the Fibonacci sequence as a calculation for computing a predicted value.
  4. The “Story” The Front-end team is anxious to deliver a

    prototype... soon. ! I’ve heard about this TDD thing, so I’m interested to give it a try. ! ...
  5. Courage is being scared to death... and saddling up anyway.

    Photo credit: http://70sbig.com/wp-content/uploads/2011/03/John-Wayne-Cowboy-Poster.jpg
  6. Ok, so How Fast? How Slow? Do I write lots

    of tests first? Or lots of code?
  7. Behavior The domain is really Stock Price Prediction. ! Retracement

    is too technical. ! Fibonacci is an implementation detail. !
  8. Behavior The domain is really Stock Price Prediction. ! Retracement

    is too technical. ! Fibonacci is an implementation detail. ! The UI team won’t know or care.
  9. This seems like a lot of work for very little

    code. Will I still get my production code done in time if I TDD it all?
  10. Tenacity TDD is slower than cowboy-coding or even TLMD (Test

    Later...Maybe... Development) Unless...
  11. • Quality • Expandability • Refactorability • Longevity • Understandability

    • Documentability • Team Members • Future Developers • Bug Detection/Repair • Coding Fearlessly
 See: http://www.onjava.com/pub/a/onjava/2003/04/02/javaxpckbk.html Tenacity IMNSHO, of course
  12. Tenacity Mastering the Art
 and Rhythm of TDD
 requires tenacity.

    ! See: http://www.exampler.com/discipline-and-skill.html
  13. Tenacity Mastering the Art
 and Rhythm of TDD
 requires tenacity.

    ! It is a skill... a discipline... ! See: http://www.exampler.com/discipline-and-skill.html
  14. Tenacity Mastering the Art
 and Rhythm of TDD
 requires tenacity.

    ! It is a skill... a discipline... ! like anything else. See: http://www.exampler.com/discipline-and-skill.html
  15. Tenacity “I thought: TDD is a cruel joke played upon

    me by smart people. I persisted because I trusted those people. ... [and] I got better at it.” ~ Sandi Metz (WGR’13)
  16. Create Software See: http://manifesto.softwarecraftsmanship.org/ You aren’t paid
 to write code.

    ! You are paid
 to build software. ! Coding should be Craftsmanship
  17. “Our job is not to write code but to build

    things... ! ... [to] materialize ideas.” ~ Matt Aimonetti (WGR’13) Create Software
  18. 10 Lessons 1. Courage - Conquer your Fear 2. Find

    your Peace 3. Baby Steps 4. Stay Focused 5. Listen to your Tests 6. Know your Domain 7. Refactor from Green 8. Behavior, not Implementation 9. Tenacity 10. Create Software
  19. ~ Dale Carnegie Inaction breeds doubt and fear. Action breeds

    confidence and courage. ! If you want to conquer fear, do not sit home and think about it. Go out and get busy. Photo credit: http://www.nathanmagnuson.com/leading-others-the-dale-carnegie-way/