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

结合故障定位与代码变更历史识别引入缺陷的提交

Identifying Bug Inducing Commits by Combining Fault Localisation and Code Change Histories

Gabin An, Jinsu Choi, Jingun Hong, Naryeong Kim, Shin Yoo

AI总结:

本文提出 Fonte,通过融合故障定位得到的代码可疑度与版本控制中的代码—提交关系来排序引入缺陷的提交,并在开源 Java 项目和大型工业系统中验证其显著提升 MRR、减少检查成本。

摘要:

Bug Inducing Commit(BIC,引入缺陷的提交)是一种将缺陷引入代码库的代码变更。尽管由该缺陷导致的异常或意外行为可能不会立即显现,但它最终会在后续过程中引发程序失败。当观察到此类程序失败时,识别相关的 BIC 可以辅助缺陷解决过程,因为了解代码变更背后的原始意图和上下文,以及获得与该变更作者的联系,能够促进缺陷分诊和调试。然而,现有的 BIC 识别技术存在局限性。二分法可能带来高昂的计算开销,因为它需要针对代码库的先前版本执行失败测试。其他技术则依赖于特定事后产物的可用性,例如缺陷报告或缺陷修复。本文提出一种名为 Fonte 的技术,旨在识别 BIC;其核心概念是:如果一个提交更近地修改了高度可疑包含缺陷的代码元素,那么该提交更有可能是 BIC。为实现这一思想,Fonte 利用软件中的两种基本关系:其一是失败到代码的关系,可通过故障定位技术进行量化;其二是代码到提交的关系,可从版本控制系统中获得。我们使用来自开源 Java 项目的 206 个真实 BIC 进行实证评估,结果表明 Fonte 显著优于最先进的 BIC 识别技术,MRR 最高提升 45.8%。我们还报告,Fonte 产生的排序分数可用于执行加权二分。最后,我们将 Fonte 应用于一个超过 1000 万行代码的大型工业项目,结果显示,在所研究的真实批量测试失败中,它能在 87% 的情况下将实际 BIC 排在前五个提交之内,并平均节省 32% 的 BIC 检查成本。

英文摘要:

A Bug Inducing Commit (BIC) is a code change that introduces a bug into the codebase. Although the abnormal or unexpected behavior caused by the bug may not manifest immediately, it will eventually lead to program failures further down the line. When such a program failure is observed, identifying the relevant BIC can aid in the bug resolution process, because knowing the original intent and context behind the code change, as well as having a link to the author of that change, can facilitate bug triaging and debugging. However, existing BIC identification techniques have limitations. Bisection can be computationally expensive because it requires executing failing tests against previous versions of the codebase. Other techniques rely on the availability of specific post hoc artifacts, such as bug reports or bug fixes. In this paper, we propose a technique called Fonte that aims to identify the BIC with a core concept that a commit is more likely to be a BIC if it has more recently modified code elements that are highly suspicious of containing the bug. To realise this idea, Fonte leverages two fundamental relationships in software: the failure-to-code relationship, which can be quantified through fault localisation techniques, and the code-to-commit relationship, which can be obtained from version control systems. Our empirical evaluation using 206 real-world BICs from open-source Java projects shows that Fonte significantly outperforms state-of-the-art BIC identification techniques, achieving up to 45.8% higher MRR. We also report that the ranking scores produced by Fonte can be used to perform weighted bisection. Finally, we apply Fonte to a large-scale industry project with over 10M lines of code, and show that it can rank the actual BIC within the top five commits for 87% of the studied real batch-testing failures, and save the BIC inspection cost by 32% on average.

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

↑