Unit testing is so satisfying! I wanted to say that it was more satisfying than refactoring, but then that is wrong. Not that I didn't feel that it was, but wrong in the sense that it is the wrong way to be looking at the practice, i.e. in isolation.
The satisfaction comes, I feel, more from the craftsmanship that I am experiencing, then the joy in a practice. I really am not sure how to describe what I'm seeing, but the practices are acting as guidelines to help me to realize the craftsmanship that can be found in software development. But then I seem to be digressing a bit from what I wanted to record...
I'm wondering now why I had any resistance to start unit testing my legacy code. Note to future self - when in doubt, do it anyway and look at the feedback and only then decide the course of action to take.
Anyway, I've got testing happening. Lots of red bars followed by green bars. Immediate and positive feedback. But I've got legacy code that already "works", so how come the red bars? I've been purposefully writing failing tests. For example, a method should return false, therefore my first assertion is that it is true. Red bar. Ok, now I think that I've tested what I meant to test. Change the assertion to be what I thought it should be. Green bar. Now I have the confidence that what I thought was testing is now automated. So I've been writing tests, but writing failing tests first, which is normal for TDD. But I'm not changing my code base yet.
During this, I felt the need to expand on what I was doing. So, next step is an
Ant script for build and testing. Then installing and set up
Cobertura for coverage feedback. Finally, set up
CruiseControl for automated builds. I suspect that most of this isn't something that I'm going to want to do after hours. Hence, I need a free weekend, which I may not have for a while. Once I do, though, I plan on moving forward.