Telerik blogs

Unit testing your legacy code while refactoring it and adding new functionality is crucial for the future success of your applications.

There is no doubt that one of the most valuable assets for any organization is the code currently powering their production systems—what’s referred to as “legacy code.”

That code sees a lot of changes, for two reasons: First, it’s always cheaper to deliver new functionality by building on legacy code. And second, production code must respond to changes in the world around it. As a result, the typical IT department spends 70% to 90% of their time in “software maintenance”: extending, modifying and sometimes fixing legacy code. Our new ebook will help you learn the most effective approaches and tools for unit testing legacy code.

Probably most of your applications consist of “legacy code”: code that was written sometime in the past, in accordance with some now obsolete standard (or, in some cases, to no apparent standard at all). As a result, legacy code often carries a lot of technical dept—which is why legacy code often has a bad reputation.

The truth is that the worst that can be said about legacy code is that it reflects the time it was written in. While it’s true that organizations have developed better practices for creating code (with many of those practices specifically intended to support automated testing), assuming those practices will never become outmoded is naïve.

More importantly, while code can start with a good design, as changes pile on, “code slowly sinks from engineering to hacking,” to quote Martin Fowler. “In the end, all code becomes legacy code.”

But, while the normal state of all code is “legacy,” not all of it comes with automated tests. Wrapping an existing application in unit tests would be an enormous task without an obvious payoff. Fortunately, that’s the wrong approach to integrating unit testing with legacy code.

Maybe you need a new approach to seamless unit testing legacy code?

Our guide to the most effective approaches for unit testing legacy code was just published and it’s ready for download.

In fact, using the current set of available development and mocking tools, you have at least two strategies for leveraging automated testing to ensure that the changes you make to your existing code base meet and continue to meet your quality standards.

See some real examples and case studies combined with practical and expert advice to facilitate the entire process of unit testing legacy code in your organization.

The ebook is written by proven expert in the field Peter Vogel. He is a system architect and principal in PH&V Information Services. PH&V provides full-stack consulting from UX design through object modeling to database design. In addition to regularly contributing to the Telerik blog, Peter also writes courses and teaches for Learning Tree International.

Download the FREE ebook

If you download the ebook, we’ll soon follow up with more resources on the topic. Stay tuned!


Galina
About the Author

Galina Jordanowa

Galia is a Product Marketing Manager for Telerik Reporting, Telerik Report Server and Telerik DevCraft at Progress. She has 18+ years in marketing, improving the sales, performance and reputation of a great number of international companies. Outside of work, she enjoys reading, psychology, mountain climbing and music.

Related Posts

Comments

Comments are disabled in preview mode.