Moving forward
Once the legacy system has been sufficiently refactored and a comprehensive suite of tests has been added, you may begin to think of the application as non-legacy, current, or a present-day system. It should now be trivial to add new features and squash any newly discovered defects. From this point forward, any new feature requested should be easily added with the confidence that other parts of the system will not be negatively affected.
The legacy application is no longer legacy. With a comprehensive suite of tests, you are now safe to proceed in Test-Driven Development fashion and write tests as every new feature is added. Remember to keep your tests as clean and well-refactored as any part of the production system.
Taking the GetPercent
example above, how might you modify this in order to return two decimal places? Why, by writing new tests, of course! Start by creating a test to return two decimal places based on the input value.
Your test might look something like this...