views:

52

answers:

3

Our project is currently under maintenance. We have never had unit testing for this project. We were planning on writing unit test for the delta's rather than writing unit test for the entire application. What would be the preferred approach. Does it really add value to add unit testing during the maintenance phase ??? We are still with .net 1.1 and might be going for an upgrade to .net 4.0 in the future.

I was wondering if someone did a ROI to sell this to the business ??

+2  A: 

The preferred approach is to cover all of your existing code with unit tests before you delta it, but you may not have the budget for that. Unit tests for your changes is certainly better than nothing.

If you already have adequate integration/verification/acceptance tests, that should suffice.

Robert Harvey
+1  A: 

Ideally you should have unit tests covering your entire project, not just future deltas. This is especially important if you plan to do a major infrastructure upgrade, because it essentially means that your entire project is a "delta".

Whether it is really worth putting the effort into this depends on how much you really want to support this project going forward.

Christopher Barber
+1  A: 

It all depends on how often and why your code is churned. However, in any case Unit Testing and comprehensive unit test suite is more like long-term investment.

If the majority of the changes are due to field/customer issues, than the ROI for UnitTest for (legacy) code in maintenance phase should come from reducing the time to fix problems, reduce number of bugs introduced (or exposed) with the deltas and reduce time to indentify root-cause of the issues.

If the code churn is caused by small features (improvements and/or customer requests) than ROI should come from shorter delivery time (better quality code, more confidence, enable TDD etc.).

Unit Tests in general should increase developer's confidence in the code base and provide some kind of sefety net for the changes.

ratkok