What payoffs have you seen from taking care of technical debt

clean codecode-qualityrefactoringtechnical-debt

This article on technical debt has some good points, including:

Working on the "technical matters" works best when it is driven by stories. The code base is probably in need of work everywhere, but the payoff will be received only where the code is going to be worked on for user-facing reasons. If no stories are going to pass through some crufty area, working on it is largely wasted.

Therefore, I prefer the approach of taking stories as usual (but probably fewer of them), and following the "boy scout rule" of leaving the campground better than you found it. In other words, wherever the stories lead us, let's write more tests, let's refactor more aggressively.

This approach has at least these advantages:

  • maintains "best sensible" flow of stories;
  • provides help from all team talent;
  • provides for whole team to learn how to keep code clean;
  • focuses improvement exactly where it is needed;
  • does not waste improvement that "may" be needed;

I've seen code quality have a very big effect on long-term productivity, so I am a believer that technical debt should be taken care of. I think the post above makes sense, but I'm not so sure about the last two points. I'm interested in finding out real experiences of benefits from cleaning technical debt, even if it was not related to user stories.

What positive benefits have you seen from cleaning up your code base and ridding yourself of technical debt? What methods did you use to get the work done?

Best Answer

I can give you one example from my experience.

About 10 or 12 years ago I inherited an application from a team of developers that ended up leaving the company (too long to get into here...). The system was a large home-grown middleware report generation system. It ran every week night and generated about 2 dozen Excel reports for senior executives of a Fortune 500 company. When I inherited it, it took about 5-6 hours to run and during any given week would fail at least 2 nights.

I was not a happy camper to be given this mess.

Initially my plan was just to stop the bleeding and fix the main cause of the failures. After I became more comfortable with the code base, I started looking for places where I could refactor and add stability and performance. Over the course of 2 years or so, I made many, many changes to the system. We retired that system a couple of years ago and at that point the whole process took 45 minutes to run and hadn't generated any issues in years.

A lot of work went into paying down the technical debt but it was well, well worth it. It was nice not getting any phone calls in the middle of the night that the system failed. It was nice coming into the office in the monring and seeing nothing but good news in the logs.

(Aside... After a couple of years I ran into one of the main developers of this system. He asked me how it was doing and I told him how bad the system was. He actually apologized and told me he knew it would be a handful to support after he left and wished he had done a better job on it).

Related Topic