Hear hear! I've worked on site where the existing code is sufficiently complex, and the existing test suite so non existent, that we've ended up applying the 'Extract Algorithm' refactoring to give ourselves a restricted set of well tested functionality, and then added tests and refactored towards the same functionality as the old code.
in reply to Re: Touching it when it ain't broke
in thread Touching it when it ain't broke
It seems scary at first, but old code with no tests is scarier still. Especially when that code is a tightly coupled mess of objects with no consistent naming style, let alone a consistent code layout style. Our new code doesn't do everything the old code does. Yet. But it's reasonably clear, naming is consistent and IT HAS TESTS! Tests are great. I really cannot recommend them highly enough.