Wednesday, March 18, 2009

Unit Testing

There has been lot of writing on why Unit Testing is important as a software developer. Common Sense dictates that you do Unit Testing. But software engineers rarely do. Voltaire was right. The typical progression is something like this :

When you start a feature you diligently start testing . Some assumptions are made. As the feature develops the assumptions change , become invalid. On completing a feature some complicated features get tested but basic features get missed out. If the company that you work for does not make it mandatory for Unit Testing then this completely gets dropped by the wayside until a customer notices it . Or worse it shows up when the Big Boss demonstrates this to a high powered investment team

One of the reasons I feel that Unit Testing does not get done is because of the over confidence of the software developer . Engineers assume that using standard components work . The do not factor for Murphy's law The answer in all cases to the question "Have you tested the feature? " is almost the same
But the manual says that this should work . How can this not work.

Unit Testing is also expensive. It requires a lot of investment of time and effort. And it requires a steep learning curve. It is not a Fill It Shut It style of work. It needs constant tweaking . As a software developer time is premium and it makes complete sense to spend most of the time on a software development rather than unit testing .