What can be done to prevent legacy decay?

There must be something that can be done to prevent this decay, right? The answer is probably predictable, given the topic of this book. But let me answer with a quote from Michael Feathers on the definition of legacy code:

To me, legacy code is simply code without tests. 
- Michael Feathers, Working Effectively with Legacy Code

As we discussed in earlier chapters, tests allow you to refactor. The ability to change the structure of the code is precisely what can prevent the rot and decay that is legacy code.

While tests can allow you to prevent legacy code from forming, be aware that they themselves do not prevent the legacy problem. It takes the dedication of every person on the team understanding ...

Get Improving your C# Skills now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.