Introduce unit testing when codebase is already available
- by McMannus
I've been working on a project in Flex for three years now without unit testing. The simple reason for that is the fact that I just didn't realize the importance of unit testing when being at the beginning of studies at university. Now my attitude towards testing changed completely and therefore I want to introduce it to the existing project (about 25000LOC).
In order to do it, there are two approaches to choose from:
1) Discard the existing codebase and start from scratch with TDD
2) Write the tests and try to make them pass by changing the existing code
Well, I would appreciate not having to write everything from scratch but I think by doing this, the design would be much better.
What would you advise me to do?
Thanks for replies in advance!
Jan