At a recent one on one, I was asking one of my developers how he’d found trialling TDD on a recent project. He said that while at first he’d found it uncomfortable, once he got going it felt great. Aside from any benefits in design he raised a very interesting point that I’d not considered before. He noted that when writing tests after the implementation the test and the implementation often looked very similar. This meant that not only is the test likely to be more fragile over time, it is also more likely to duplicate any bugs already present in the implementation. By writing the tests first this problem disappears, since the test is more concerned with intent and the implementation itself is yet to be considered.
So things have been hectic over the past few months and fragile has taken a back seat, but I thought I’d relay the following since I thought it was pretty cool.