A Bug Inducing Commit (BIC) is a commit that introduces a software bug into the codebase. Knowing the relevant BIC for a given bug can provide valuable information for debugging as well as bug triaging. However, existing BIC identification techniques are either too expensive (because they require the failing tests to be executed against previous versions for bisection) or inapplicable at the debugging time (because they require post hoc artefacts such as bug reports or bug fixes). We propose Fonte, an efficient and accurate BIC identification technique that only requires test coverage. Fonte combines Fault Localisation (FL) with BIC identification and ranks commits based on the suspiciousness of the code elements that they modified. Fonte reduces the search space of BICs using failure coverage as well as a filter that detects commits that are merely style changes. Our empirical evaluation using 130 real-world BICs shows that Fonte significantly outperforms state-of-the-art BIC identification techniques based on Information Retrieval as well as neural code embedding models, achieving at least 39% higher MRR. We also report that the ranking scores produced by Fonte can be used to perform weighted bisection, further reducing the cost of BIC identification. 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.
翻译:摘要:缺陷引入提交(BIC)是指将软件缺陷引入代码库的提交。对于给定的缺陷,识别相关BIC可为调试和缺陷分类提供有价值的信息。然而,现有的BIC识别技术要么成本过高(因为需要在先前版本上执行失败测试以实现二分查找),要么在调试时不可用(因为需要缺陷报告或缺陷修复等事后制品)。我们提出Fonte——一种仅需测试覆盖率的、高效且精准的BIC识别技术。Fonte将故障定位(FL)与BIC识别相结合,并根据提交所修改代码元素的疑似程度对其进行排名。它利用失败覆盖率和检测纯样式变更提交的过滤器,有效缩小BIC的搜索空间。基于130个真实世界BIC的实证评估表明,Fonte显著优于基于信息检索及神经代码嵌入模型的最新BIC识别技术,MRR至少提升39%。我们还发现,Fonte生成的排名分数可用于加权二分查找,进一步降低BIC识别成本。最后,我们将Fonte应用于一个拥有超过1000万行代码的大型工业项目,结果显示:在87%的真实批量测试失败案例中,实际BIC被排入前五位,平均节省32%的BIC检查成本。