I’m just embarking on a new project today and looking through the existing code base. One of the components has some unit tests, which made me smile. None of the other components (about 8 in total) have any tests :(
This suite of components was written in a short time frame over a year ago and it works perfectly for the job that was required then. In fact it has been in use by (so I am told) several thousand users around the world for the last year. Of course there have been a few issues reported but no show stoppers. In many ways I have to say "good job" to the original development team.
The issue now is that the suite of components needs to extend its functionality further to cater for some technology changes and to open up new opportunities.
So the classic dilemma; do I rewrite the parts that need changing (in a test driven manner of course) OR do I rework the existing components and add tests as I go?
I don’t want to rewrite code that is working and has been field tested. I also don’t feel comfortable adding to code that doesn’t have unit tests. Without unit tests for the existing code I won’t know if I’ve broken any of the current functionality through the changes I am making.
To be continued …