Using AI Coding Assistants to Reduce Technical Debt: What the Research Shows

We usually talk about AI coding assistants as tools for writing code faster. GitHub Copilot, ChatGPT, and similar tools can generate functions, explain existing code, and help developers solve problems.

But there is another interesting question:

Can AI help us maintain the code we already have?

I recently had an opportunity to read research by my friend Mariya Ruffcorn on this topic. Her paper, “Leveraging AI Coding Assistants for Code-Level Technical Debt Repayment: Capabilities, Limitations, and Research Gaps,” examines existing research on using AI coding assistants to repay code-level technical debt.

I found the subject interesting because technical debt is something almost every development team understands.

There is always pressure to deliver new functionality. Sometimes we make compromises. Sometimes code that was perfectly reasonable five years ago becomes difficult to maintain today. Requirements change, technologies change, and additional changes make the code more complex.

Eventually, somebody has to deal with it.

AI potentially changes the economics of that work.

AI Can Help, but Repayment Is Not Automatic

One of the important points from Mariya’s research is that AI coding assistants can help with technical debt.

Existing studies show that AI can propose changes for problems such as self-admitted technical debt, code smells, and certain refactoring tasks.

That sounds promising.

But there is an important distinction between changing code and repaying technical debt.

An AI assistant can easily generate a different implementation. The new code may even look cleaner. That doesn’t automatically mean the underlying maintainability problem has been solved.

The AI could remove one problem and introduce another one.

So perhaps the wrong question is:

Can AI rewrite this code?

A better question is:

Can AI rewrite this code in a way that actually improves maintainability without changing the required behavior or introducing new problems?

That is a much higher bar.

Context Matters

Another finding that caught my attention is the importance of context.

AI coding assistants tend to perform better when the repayment target is clearly defined and the model receives enough information about the surrounding code.

This makes intuitive sense.

Consider these two prompts:

Improve this code.

and:

This method has become difficult to maintain because it performs validation, data retrieval, transformation, and error handling. Refactor it to reduce complexity while preserving its existing behavior.

The second request gives the AI a much clearer target.

But prompting is only part of the problem.

Real applications are not collections of independent functions. Code depends on other classes, libraries, configuration, data structures, business rules, tests, and architectural decisions.

A developer working on the application may understand those relationships. An AI assistant sees only the context available to it.

As the problem becomes larger and crosses more files and dependencies, determining what constitutes a “better” implementation also becomes harder.

Validation Still Matters

This may be the most important practical takeaway from the research.

AI-generated code still needs to be validated.

The fact that code was generated as a technical-debt fix doesn’t mean the resulting code is necessarily better.

Normal engineering controls still apply:

  • Does it compile?
  • Do the existing tests pass?
  • Does static analysis identify new problems?
  • Did complexity actually decrease?
  • Did the change introduce another code smell?
  • Is the code understandable to another developer?
  • Does it preserve the expected behavior?

And ultimately:

Would a developer approve this change in a normal code review?

I think this point is sometimes lost in discussions about AI development tools.

We shouldn’t have one quality standard for developer-written code and another one for AI-generated code.

If anything, AI makes existing validation practices more important because generating changes becomes so inexpensive.

AI as an Assistant, Not an Autonomous Cleanup Engine

For me, the research points toward a practical model for using AI.

I wouldn’t point an AI assistant at a large repository and say:

Find our technical debt and fix it.

Instead, I would use AI much closer to the normal development process:

Identify a specific problem → provide appropriate context → ask AI for a candidate solution → test it → analyze it → review it → accept or reject it.

AI fits somewhere in the middle of that process.

The developer still decides what needs to be fixed and whether the result is acceptable.

That doesn’t make AI unimportant. Quite the opposite.

If AI can reduce the amount of repetitive work involved in refactoring, exploring alternative implementations, or addressing relatively well-defined code problems, technical-debt repayment may become cheaper.

And that matters because one of the biggest problems with technical debt has always been prioritization.

There is usually another feature to build.

There is usually another production issue.

Maintenance work has to compete with work that produces more visible business value.

If AI reduces the effort required to address some forms of technical debt, problems that previously remained in the backlog may become practical to fix.

Where I Think This Gets Interesting

Today, much of the research focuses on relatively defined problems, including self-admitted technical debt and individual code smells.

The harder question is what happens at scale.

A real enterprise application may have hundreds of projects, thousands of dependencies, years of development history, undocumented design decisions, and business rules that aren’t obvious from the source code alone.

Can an AI coding assistant understand enough of that environment to make significant maintainability decisions safely?

I don’t think we should assume that it can.

But we also shouldn’t dismiss what AI can already do because it cannot solve the entire problem.

There is a large space between manually doing all technical-debt work and allowing AI to autonomously modify an application.

That middle ground is probably where AI coding assistants are most useful today.

Final Thoughts

What I took away from Mariya’s work is relatively simple:

AI can help us repay technical debt, but it doesn’t eliminate the engineering discipline required to do it correctly.

AI can generate candidates, assist with refactoring, and potentially reduce some of the manual effort involved in maintaining existing software.

But developers still need to provide context, validate the results, and remain responsible for the final code.

In other words:

AI may reduce the effort required to repay technical debt without removing responsibility from the developer.

That seems like a much more realistic way to think about AI coding assistants than either extreme of “AI will replace developers” or “AI just generates unreliable code.”

There is considerably more behind this topic than I can cover in one blog post. Mariya’s work goes deeper into the existing research, factors affecting successful repayment, current limitations, and a proposed process for integrating AI-assisted technical-debt repayment into the software development workflow.

I’d like to thank Mariya Ruffcorn for sharing her research with me and allowing me to discuss some of its findings here.

Research behind this article

Mariya Ruffcorn
Leveraging AI Coding Assistants for Code-Level Technical Debt Repayment: Capabilities, Limitations, and Research Gaps
MIS 599 Creative Component, 2026.

Leave a Reply

Your email address will not be published. Required fields are marked *