Your SlideShare is downloading. ×
Test Driven Development - Caleb Tutty
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

Test Driven Development - Caleb Tutty


Published on

The slides for Caleb Tutty's excellent talk on Test Driven Development, presented at the first Auckland Web Dev Nights meetup on the 26th April, 2012. …

The slides for Caleb Tutty's excellent talk on Test Driven Development, presented at the first Auckland Web Dev Nights meetup on the 26th April, 2012.

Published in: Technology
  • Be the first to comment

No Downloads
Total Views
On Slideshare
From Embeds
Number of Embeds
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

No notes for slide


  • 1. TEST DRIVEN DEVELOPMENT Auckland WebDev Nights Meetup - 26th April 2012Sunday, 29 April 12
  • 2. Who are you? Hi, I’m Caleb Tutty - [that’s Tuh-tee] Ruby on Rails developer working at onebigvoice twitter: @Caleb_T email: github: Feel free to pipe up with questions at any point, but there will be time at the end too.Sunday, 29 April 12
  • 3. What do I mean by testing? Automated testing. Tests written by developers to check the functionality of their application behaves as they expect it to. (Assertions). These tests are run by a test suite. Test broadly fall into two groups - unit tests and integration tests Unit tests look at isolated parts of functionality, and ensuring that each part does what you thought it should. (e.g. Controllers and Models) Integration tests are higher level - and aimed at the integrated user experience. These test that everything plays nicely with each other (e.g. the View layer interacting with Controllers and models)Sunday, 29 April 12
  • 4. Cool, got it. when should I test?Sunday, 29 April 12
  • 5. Cool, got it. when should I test? Not in production! Before you merge into the master branch of your source control Actually, TATFTSunday, 29 April 12
  • 6. TAFT? Test all the f@#&ing time.* Bryan Liles - rubyhoedown2008-lightning-talk-tatft-test-all-the-f-in-time * Remember this as a qualification for later: “Quidquid latine dictum sit, altum sonatur.”Sunday, 29 April 12
  • 7. Really, all the time? Why? Tests give you notifications when a change breaks part of your app Tests tell you where to look Tests document your application Tests help you work in teams Tests mean that you can come back to a feature later and remind you what the hell you were doingSunday, 29 April 12
  • 9. “Quidquid latine dictum sit, altum sonatur.” Anything in Latin sounds profound...Sunday, 29 April 12
  • 10. Too much testing? “I get paid for code that works, not for tests, so my philosophy is to test as little as possible to reach a given level of confidence (I suspect this level of confidence is high compared to industry standards, but that could just be hubris). If I don’t typically make a kind of mistake (like setting the wrong variables in a constructor), I don’t test for it. I do tend to make sense of test errors, so I’m extra careful when I have logic with complicated conditionals. When coding on a team, I modify my strategy to carefully test code that we, collectively, tend to get wrong.” - Kent Bent, of Test First development fame source: 153565#153565Sunday, 29 April 12
  • 11. Too much testing? “When developers first discover the wonders of test-driven development, it’s like gaining entrance to a new and better world with less stress and insecurity. It truly is a wonderful experience well worth celebrating. But internalizing the benefits of testing is only the first step to enlightenment. Knowing what not to test is the harder part of the lesson.” - DHH (creator of Rails) source:, 29 April 12
  • 12. but testing is only for Rails devs, amirite? Nope! PHP Python Node.js and JavaScript AS3 - I know there’s a Flex Dev in the audience .NET - Visual Studio has unit testing since VS 2005 - (well.. except for the free Express versions - tests-please/ and ) “I’m not one who says everything should be free. Microsoft do not claim to offer a free full-blown development environment; that’s OK. But from all things that you can leave out: why does it have to be the all abilities to run unit tests? That seems like a strange signal towards the importance of quality.”Sunday, 29 April 12
  • 13. is there moar? Beyond the scope of this talk: Factories versus Fixtures Cucumber and BDD JavaScript testing Spork and Continuous Integration ServersSunday, 29 April 12
  • 14. QUESTIONS?Sunday, 29 April 12