Thursday 16 September 2010

TDD talk by John Smart

I went to a free talk given by John Smart last night hosted by Skills Matter which had a couple of interesting points, firstly that when practicing TDD you should stop writing unit tests called AccountTest with methods such as testGetBalanceOpeningBalance and name your test classes and methods to better represent the requirements they are testing, such as openingBalanceIsZero in a NewAccountProperties test class. I asked him how he would recommend convincing co-developers that the assertion they don't have time to write tests is a fallacy, and he suggested pair programming for a day to show developers how TDD works. I think this is a good suggestion, however in my experience people who don't have time to test, don't have time to pair either.

He also mentioned a couple of interested projects, in particular
  • Infinitest which is a plugin for both Eclipse and IntelliJ which locally runs relevant unit tests as soon as you save a file, cutting down the feedback time between code change and test failure usually experienced with a CI server.
  • easyb which is a behaviour driven development library which allows business requirements to be codified, initially as human readable text, and then fleshed out by developers/testers in code and assertions.
I've installed the Infinitest Eclipse plugin and it seems pretty seamless, I'm looking forward to trying both out in a big project.