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的工具的准确性,更强调其在通过主动代码改进与教育来精简软件开发生命周期方面的潜力。