Several Deep Learning (DL)-based techniques have been proposed to automate code review. Still, it is unclear the extent to which these approaches can recommend quality improvements as a human reviewer. We study the similarities and differences between code reviews performed by humans and those automatically generated by DL models, using ChatGPT-4 as representative of the latter. In particular, we run a mining-based study in which we collect and manually inspect 739 comments posted by human reviewers to suggest code changes in 240 PRs. The manual inspection aims at classifying the type of quality improvement recommended by human reviewers (e.g., rename variable/constant). Then, we ask ChatGPT to perform a code review on the same PRs and we compare the quality improvements it recommends against those suggested by the human reviewers. We show that while, on average, ChatGPT tends to recommend a higher number of code changes as compared to human reviewers (~2.4x more), it can only spot 10% of the quality issues reported by humans. However, ~40% of the additional comments generated by the LLM point to meaningful quality issues. In short, our findings show the complementarity of manual and AI-based code review. This finding suggests that, in its current state, DL-based code review can be used as a further quality check on top of the one performed by humans, but should not be considered as a valid alternative to them nor as a mean to save code review time, since human reviewers would still need to perform their manual inspection while also validating the quality issues reported by the DL-based technique.


翻译:已有多种基于深度学习(DL)的技术被提出以自动化代码审查。然而,这些方法能在多大程度上像人类审查者一样推荐质量改进尚不明确。我们以 ChatGPT-4 作为后者的代表,研究了人类执行的代码审查与深度学习模型自动生成的代码审查之间的相似性和差异。具体而言,我们开展了一项基于挖掘的研究,收集并人工检查了 240 个拉取请求中由人类审查者发布的 739 条建议代码更改的评论。人工检查旨在对人类审查者推荐的质量改进类型(例如,重命名变量/常量)进行分类。然后,我们要求 ChatGPT 对相同的拉取请求进行代码审查,并将其推荐的质量改进与人类审查者建议的进行比较。我们发现,虽然 ChatGPT 平均倾向于推荐比人类审查者更多的代码更改(约多 2.4 倍),但它只能发现人类报告的 10% 的质量问题。然而,该大语言模型生成的额外评论中约有 40% 指出了有意义的质问题。简而言之,我们的研究结果表明了人工与基于人工智能的代码审查具有互补性。这一发现表明,在当前状态下,基于深度学习的代码审查可以作为人类审查之上的一项额外质量检查手段,但不应被视为人类审查的有效替代方案,也不应被视为节省代码审查时间的方法,因为人类审查者仍然需要进行人工检查,同时还需验证基于深度学习技术报告的质量问题。

0
下载
关闭预览

相关内容

代码(Code)是专知网的一个重要知识资料文档板块,旨在整理收录论文源代码、复现代码,经典工程代码等,便于用户查阅下载使用。
文本、视觉与语音生成的自动化评估方法综述
专知会员服务
20+阅读 · 2025年6月15日
悉尼科大董宣毅等:「自动深度学习AutoDL」2021进展
专知会员服务
29+阅读 · 2021年12月20日
基于深度学习的行人重识别研究进展,自动化学报
专知会员服务
39+阅读 · 2019年12月5日
【综述论文】2020年最新深度学习自然语言处理进展综述论文!!!
深度学习自然语言处理
13+阅读 · 2020年4月6日
NLP中自动生产文摘(auto text summarization)
机器学习研究会
14+阅读 · 2017年10月10日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
3+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
12+阅读 · 2013年12月31日
VIP会员
相关VIP内容
文本、视觉与语音生成的自动化评估方法综述
专知会员服务
20+阅读 · 2025年6月15日
悉尼科大董宣毅等:「自动深度学习AutoDL」2021进展
专知会员服务
29+阅读 · 2021年12月20日
基于深度学习的行人重识别研究进展,自动化学报
专知会员服务
39+阅读 · 2019年12月5日
相关基金
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
3+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
12+阅读 · 2013年12月31日
Top
微信扫码咨询专知VIP会员