In this paper, we present a novel approach to improving software quality and efficiency through a Large Language Model (LLM)-based model designed to review code and identify potential issues. Our proposed LLM-based AI agent model is trained on large code repositories. This training includes code reviews, bug reports, and documentation of best practices. It aims to detect code smells, identify potential bugs, provide suggestions for improvement, and optimize the code. Unlike traditional static code analysis tools, our LLM-based AI agent has the ability to predict future potential risks in the code. This supports a dual goal of improving code quality and enhancing developer education by encouraging a deeper understanding of best practices and efficient coding techniques. Furthermore, we explore the model's effectiveness in suggesting improvements that significantly reduce post-release bugs and enhance code review processes, as evidenced by an analysis of developer sentiment toward LLM feedback. For future work, we aim to assess the accuracy and efficiency of LLM-generated documentation updates in comparison to manual methods. This will involve an empirical study focusing on manually conducted code reviews to identify code smells and bugs, alongside an evaluation of best practice documentation, augmented by insights from developer discussions and code reviews. Our goal is to not only refine the accuracy of our LLM-based tool but also to underscore its potential in streamlining the software development lifecycle through proactive code improvement and education.
翻译:本文提出了一种基于大语言模型(LLM)的新型方法,通过设计专门用于审查代码并识别潜在问题的模型,以提升软件质量与效率。我们提出的LLM驱动型AI代理模型基于大型代码库进行训练,训练数据涵盖代码审查、缺陷报告及最佳实践文档。该模型旨在检测代码异味、识别潜在缺陷、提供改进建议并优化代码结构。与传统静态代码分析工具不同,我们的LLM型AI代理具备预测代码未来潜在风险的能力,这双重目标既有助于提升代码质量,又能通过鼓励开发者深入理解最佳实践和高效编码技术来促进其教育。此外,我们通过分析开发者对LLM反馈的情感态度,证明了该模型在提出显著减少发布后缺陷并优化代码审查流程的改进建议方面的有效性。未来工作将聚焦于评估LLM生成的文档更新相较于人工方法的准确性与效率,计划通过实证研究比较人工代码审查与模型在识别代码异味和缺陷方面的差异,并结合开发者讨论与审查见解评估最佳实践文档的质量。这不仅旨在完善LLM工具的精确性,更意在凸显其通过主动式代码改进与教育来简化软件开发流程的潜力。