måndag 12 oktober 2009

FitNesse revisited

I recently wrote about FitNesse saying that our goal was to allow domain experts to get on with testing while the developers could concentrate on building new features.

Wrong. Wrong. Wrong.

What I should have said was that the key to acceptance testing with FitNesse is collaboration. Testers and developers should work together when writing tests and developing features. This is what FitNesse makes possible.

Testing will always come at a cost. The trick is to make sure the returns exceed this cost. Junit has made this possible for unit testing.

When it comes to acceptance testing, the cost-benefit relationship is not so clear. FitNesse can swing the balance in favour of automation. So here's my revised list of tips for how to do this:
  1. Collaborate when creating acceptance tests. Developers and testers should be encouraged to work together.
  2. Create separate FitNesse fixtures for setting up test data, exercising the SUT, and making assertions on the result.
  3. Names are important. The readability of your test cases will improve.
  4. Write unit tests for your fixtures. Their design will benefit.
  5. Keep your tests independent. Intra test dependencies will lead to tears.
  6. Use dependency injection. Decoupled fixtures can be reused more easily.
  7. Document your fixtures. This will help you write clear test cases.
  8. Think carefully about logging. Debugging will be less painful.