重新思考借助LLM的代码审查工作流:一项实证研究
Rethinking Code Review Workflows with LLM Assistance: An Empirical Study
AI总结:
本研究通过现场研究与实验,探讨LLM辅助代码审查工具在真实开发环境中的效果,发现AI主导审查更受青睐,但受代码熟悉度和拉取请求严重性影响。
摘要:
代码审查是现代软件开发中关键但耗时的一环,日益受到系统复杂性增长和更快交付需求的挑战。本文介绍了一项在瑞典WirelessCar公司开展的研究,将当前代码审查实践的探索性现场研究与涉及两种LLM辅助代码审查工具变体的现场实验相结合。现场研究识别出传统代码审查中的关键挑战,包括频繁的上下文切换、上下文信息不足,并指出了使用LLM的机遇(例如,自动总结复杂的拉取请求)和担忧(例如,误报和信任问题)。在现场实验中,我们开发了两种原型变体:一种预先提供LLM生成的审查意见,另一种支持按需交互。两者均利用基于检索增强生成的语义搜索管道来为审查组装相关上下文信息,从而应对所发现的挑战。开发者在真实环境中对两种变体进行了评估:AI主导的审查总体上更受青睐,但这一偏好仍取决于审查者对代码库的熟悉程度以及拉取请求的严重程度。
英文摘要:
Code reviews are a critical yet time-consuming aspect of modern software development, increasingly challenged by growing system complexity and the demand for faster delivery. This paper presents a study conducted at WirelessCar Sweden AB, combining an exploratory field study of current code review practices with a field experiment involving two variations of an LLM-assisted code review tool. The field study identifies key challenges in traditional code reviews, including frequent context switching, insufficient contextual information, and highlights both opportunities (e.g., automatic summarization of complex pull requests) and concerns (e.g., false positives and trust issues) in using LLMs. In the field experiment, we developed two prototype variations: one offering LLM-generated reviews upfront and the other enabling on-demand interaction. Both utilize a semantic search pipeline based on retrieval-augmented generation to assemble relevant contextual information for the review, thereby tackling the uncovered challenges. Developers evaluated both variations in real-world settings: AI-led reviews are overall more preferred, while still being conditional on the reviewers' familiarity with the code base, as well as on the severity of the pull request.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。