18 Jan 2006

The Joy of Continuous Testing

I did a project last semester that consisted of building a small object database in C#. We had testcases for every aspect of externally observable behavior. This was the first project for which I used unit tests, and the payoff was tremendous. The most remarkable advantage is the incredible confidence I had in my code; I could make any change and know instantly whether it broke something. Moreover, when things broke that shouldn't have, it alerted me to the presence of bugs I might not have discovered otherwise because I wouldn't have tested for them. Another nice result is that the tests define what it means to have a working program. (We finally ended up with almost a 50-50 distribution of code between tests and the main system.)

No comments:

Post a Comment