arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2402.03777cs.SE
收藏

改进自动化代码审查:从经验中学习

Improving Automated Code Reviews: Learning from Experience

Hong Yi Lin, Patanamon Thongtanunam, Christoph Treude, Wachiraphan Charoenwet

AI总结:

本研究提出经验感知的过采样技术,利用高质量审查训练自动化代码审查模型,在不引入新数据的情况下提升生成审查的正确性、信息量和有意义性。

摘要:

现代代码审查是一种关键的质量保证过程,在工业界和开源软件环境中被广泛采用。这一过程可以帮助新手从经验丰富的审查者的反馈中学习;然而,它常常给审查者带来巨大的工作量和压力。为了减轻这一负担,自动化代码审查领域旨在自动化这一过程,教导大型语言模型像人类一样对提交的代码提供审查意见。最近的一种方法在大型代码审查语料库上对代码智能语言模型进行了预训练和微调。然而,这些技术并未充分利用训练数据中的高质量审查。事实上,对代码具有更高经验或熟悉度的审查者可能会比其他人提供更深入的见解。在本研究中,我们着手调查是否可以通过基于经验感知的过采样技术训练的自动化代码审查模型生成更高质量的审查。通过我们的定量和定性评估,我们发现,在不引入新数据的情况下,经验感知的过采样可以提高当前最先进模型生成的审查的正确性、信息水平和有意义性。结果表明,在当前的训练策略下,大量高质量的审查未被充分利用。这项工作为以资源高效的方式提升自动化代码审查模型提供了启示。

英文摘要:

Modern code review is a critical quality assurance process that is widely adopted in both industry and open source software environments. This process can help newcomers learn from the feedback of experienced reviewers; however, it often brings a large workload and stress to reviewers. To alleviate this burden, the field of automated code reviews aims to automate the process, teaching large language models to provide reviews on submitted code, just as a human would. A recent approach pre-trained and fine-tuned the code intelligent language model on a large-scale code review corpus. However, such techniques did not fully utilise quality reviews amongst the training data. Indeed, reviewers with a higher level of experience or familiarity with the code will likely provide deeper insights than the others. In this study, we set out to investigate whether higher-quality reviews can be generated from automated code review models that are trained based on an experience-aware oversampling technique. Through our quantitative and qualitative evaluation, we find that experience-aware oversampling can increase the correctness, level of information, and meaningfulness of reviews generated by the current state-of-the-art model without introducing new data. The results suggest that a vast amount of high-quality reviews are underutilised with current training strategies. This work sheds light on resource-efficient ways to boost automated code review models.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑