arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2411.11401cs.SE
收藏

基于深度学习的代码审查:范式转变还是双刃剑?

Deep Learning-based Code Reviews: A Paradigm Shift or a Double-Edged Sword?

Rosalia Tufano, Alberto Martin-Lopez, Ahmad Tayeb, Ozren Dabić, Sonia Haiduc, Gabriele Bavota

AI总结:

本研究聚焦深度学习驱动的自动化代码审查的实际影响,通过29名专家参与、时长超50小时的受控实验,发现其能提供有效问题反馈但未提升审查者信心与高严重性问题识别率,也未节省时间。

摘要:

已有多种技术被提出用于自动化代码审查。早期支持包括为给定变更推荐最合适的审查者,或对审查任务进行优先级排序。随着深度学习在软件工程中的出现,自动化水平被推向了新高度,相关方法能够像人类审查者一样以自然语言对源代码提供反馈。此外,近期研究记录了开源项目采用大型语言模型(LLMs)作为协同审查者的情况。尽管该领域的研究非常活跃,但关于在代码审查流程中纳入自动生成的代码审查的实际影响,人们知之甚少。虽然有许多方面值得研究,但本工作聚焦于三个方面:(i)审查质量,即审查者识别代码中问题的能力;(ii)审查成本,即审查代码所花费的时间;(iii)审查者的信心,即审查者对所提供反馈的自信程度。我们开展了一项受控实验,由29名专家在有或无自动生成的代码审查支持的情况下审查不同程序。在实验期间,我们监测了审查者的活动,记录的代码审查时长超过50小时。我们发现,审查者认为LLM自动识别的大多数问题是有效的;并且,将自动化审查作为起点会强烈影响他们的行为:审查者倾向于关注LLM指出的代码位置,而非在代码其他部分搜索额外问题。与完全手动流程相比,从自动化审查开始的审查者识别出更多低严重性问题,但并未识别出更多高严重性问题。最后,自动化支持并未节省时间,也未提升审查者的信心。

英文摘要:

Several techniques have been proposed to automate code review. Early support consisted in recommending the most suited reviewer for a given change or in prioritizing the review tasks. With the advent of deep learning in software engineering, the level of automation has been pushed to new heights, with approaches able to provide feedback on source code in natural language as a human reviewer would do. Also, recent work documented open source projects adopting Large Language Models (LLMs) as co-reviewers. Although the research in this field is very active, little is known about the actual impact of including automatically generated code reviews in the code review process. While there are many aspects worth investigating, in this work we focus on three of them: (i) review quality, i.e., the reviewer's ability to identify issues in the code; (ii) review cost, i.e., the time spent reviewing the code; and (iii) reviewer's confidence, i.e., how confident is the reviewer about the provided feedback. We run a controlled experiment with 29 experts who reviewed different programs with/without the support of an automatically generated code review. During the experiment we monitored the reviewers' activities, for over 50 hours of recorded code reviews. We show that reviewers consider valid most of the issues automatically identified by the LLM and that the availability of an automated review as a starting point strongly influences their behavior: Reviewers tend to focus on the code locations indicated by the LLM rather than searching for additional issues in other parts of the code. The reviewers who started from an automated review identified a higher number of low-severity issues while, however, not identifying more high-severity issues as compared to a completely manual process. Finally, the automated support did not result in saved time and did not increase the reviewers' confidence.

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

↑