Can AI solve your technical debt problem?

Enhanced linting. “Linting tools are purely mechanical processes which evaluate your code and flag instances where, for example, the code has too many if/then/else branches, or if a class or method body has grown too long,” says Qwoted CTO Kevin Trowbridge. “Fixing these problems is quite a bit of work, and so codebases are often littered with manual overrides — comments in the code such as ‘rubocop:disable’ or ‘rubocop:todo’ which tell the linter to ignore these issues.”

Such comments represent a classic form of tech debt: a realization by developers at the end of feature development that the code they just wrote will ultimately need to be deeply refactored. “This is where LLMs can really shine,” says Trowbridge. “The linters can often be configured to annotate the violations directly within the code, with comments such as rubocop:todo and the specific problem identified. The file can be passed directly to the LLM with simple instructions like, ‘Please resolve the rubocop:todos.’”

Tracking down outdated dependencies. Sometimes tech debt arises not because your code is bad, but because code it depends on has changed or gone sour. “AI coding assistants can identify how out of date all of the libraries and dependencies of the codebase are,” says Pete Whiting, one of the founders of the Gnar Company, a web and mobile development firm. He notes that AI can recognize such links as a problem even if it hasn’t been specifically tasked with hunting down tech debt: “These areas of the codebase are also highlighted by the AI coding assistant when prompted with some improvement requests  (e.g., improve performance, apply consistent patterns, or follow best practices.)”



Source link

Leave a Comment