arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2507.23640cs.SE
收藏

合并请求被接受所需变更量的实证研究

An Empirical Study on the Amount of Changes Required for Merge Request Acceptance

Samah Kansab, Mohammed Sayagh, Francis Bordeleau, Ali Tizghadam

AI总结:

本研究针对GitLab合并请求场景下代码审查工作量研究不足的问题,基于23600余个MR定义并量化审查工作量,构建多维度可解释机器学习模型实现0.84-0.88的AUC表现,验证了用机器学习预判审查工作量的可行性。

摘要:

代码审查(Code Review,CR)是软件开发的关键环节,有助于确保新代码被妥善集成。然而,CR流程通常需要投入大量精力,包括代码调整、回复审查者以及持续实现工作。过往研究已探讨过CR延迟和迭代次数,但鲜有研究基于所需的代码变更量来衡量审查工作量,尤其是在GitLab合并请求(Merge Requests,MRs)场景下的相关研究仍很不足。本文将CR工作量定义并量化为MR提交后被修改的代码量,基于来自4个GitLab项目的超过23600个MR的数据集开展研究。我们发现,高达71%的MR在提交后需要调整,其中28%的MR涉及超过200行代码的变更。出人意料的是,该工作量与审查时长或参与人数并无关联。为更好地理解和预测CR工作量,我们利用多维度指标训练了一个可解释机器学习模型,涵盖的维度包括文本特征、代码复杂度、开发者经验、审查历史和分支情况。该模型表现优异(AUC达0.84-0.88),且揭示出复杂度、经验和文本特征是关键预测因素,项目的历史特征也会影响当前的审查工作量。我们的研究结果表明,利用机器学习来解释和预判审查过程中集成代码变更所需的工作量具备可行性。

英文摘要:

Code review (CR) is essential to software development, helping ensure that new code is properly integrated. However, the CR process often involves significant effort, including code adjustments, responses to reviewers, and continued implementation. While past studies have examined CR delays and iteration counts, few have investigated the effort based on the volume of code changes required, especially in the context of GitLab Merge Requests (MRs), which remains underexplored. In this paper, we define and measure CR effort as the amount of code modified after submission, using a dataset of over 23,600 MRs from four GitLab projects. We find that up to 71% of MRs require adjustments after submission, and 28% of these involve changes to more than 200 lines of code. Surprisingly, this effort is not correlated with review time or the number of participants. To better understand and predict CR effort, we train an interpretable machine learning model using metrics across multiple dimensions: text features, code complexity, developer experience, review history, and branching. Our model achieves strong performance (AUC 0.84-0.88) and reveals that complexity, experience, and text features are key predictors. Historical project characteristics also influence current review effort. Our findings highlight the feasibility of using machine learning to explain and anticipate the effort needed to integrate code changes during review.

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

↑