Possible Duplicate:
Best practices for retrofitting legacy code with automated tests
When working in large legacy systems (large systems with no unit testing ever) I often come across people saying use unit testing as a tool against possible bugs. I wonder if somebody have tried it on large systems with no unit testing at all.
Of course it is easy to say unit testing helps ,but in large systems it can hugely time consuming process. It can take months if not years to fully unit test each part of the application .
When you are asked to make a functionality which is modification of existing functionality or adding new functionality to the application, how would you go about it? Of course there will be lots of instances where code in different classes will look similar and you would want to re-factor those classes which without proper unit testing can and most likely will open a can of worms.
So how would you go about unit testing large applications? And what other measures would you use to reduce possible bugs from your coding (of course some bugs will probably remain anyway)?