Wednesday, February 11, 2009

Writing tests is worth the hard work

Is writing tests harder than application code?.
Absolutely, and how can you make it easier?.
  1. Well, first step is to be aware of tons of tools available to make your life easier for writing tests (test frameworks, mock, fixtures).
  2. use the right tools in right way (when to use and not use mock)
  3. don't over test / verify (over mocking will be your maintanence nightmare)
  4. check out the video BDD with shoulda by Tammer
Second part of the video is about general testing and it covers the following
  1. Mocking (Advantages, disadvantages)
  2. Over Mocking (problems)
  3. Fixtures (why is it bad?, alternatives)
  4. White box vs Black box
  5. Brittle tests (what is it?, how to avoid?)
Is it worth the hard work? Yes, it saves hours and hours of debugging when some code broke for unknown reason.

No comments:

Post a Comment