UniLoc: Unified Fault Localization of Continuous Integration Failures

UniLoc: Unified Fault Localization of Continuous Integration Failures
复制标题

DOI:
10.1145/3593799
复制
发表时间:
2023-05
影响因子:
4.4
通讯作者:
Foyzul Hassan;Na Meng;Xiaoyin Wang
Foyzul Hassan;Na Meng;Xiaoyin Wang
中科院分区:
计算机科学1区
文献类型:
--
作者:
Foyzul Hassan;Na Meng;Xiaoyin Wang

文献摘要

相似文献

持续集成(CI)实践鼓励开发人员经常将代码集成到共享存储库中。每个集成都通过自动构建和测试进行验证,以便尽早发现错误。当报告CI故障或集成错误时,现有技术不足以自动定位根本原因,原因有两个。首先,CI故障可能由源代码和/或构建脚本中的错误触发,而当前方法仅考虑源代码。第二,尝试性的集成可能会因为构建失败和/或测试失败而失败,而现有的工具只关注测试失败。本文介绍了UniLoc,这是第一个统一的技术,可以在给定CI故障日志的情况下定位源代码和构建脚本中的故障,而无需假设故障的位置(源代码或构建脚本)和性质(测试失败与否)。采用信息检索(IR)策略,UniLoc定位错误文件,将源代码和构建脚本视为要搜索的文档,并将构建日志视为搜索查询。然而,为了更准确地定位故障,UniLoc并没有天真地将现成的IR技术应用于这些软件工件,而是应用了各种特定于域的算法来优化搜索查询、搜索空间和排名公式。为了评估UniLoc,我们在72个使用Gradle构建的开源项目中收集了700个CI故障修复。UniLoc可以有效地定位错误,平均倒数秩值为0.49,平均精度值为0.36,归一化折扣累积增益值为0.54。UniLoc优于最先进的基于IR的工具BLUiR和Locus。UniLoc有可能帮助开发人员更准确、更有效地诊断CI故障的根本原因。
Continuous integration (CI) practices encourage developers to frequently integrate code into a shared repository. Each integration is validated by automatic build and testing such that errors are revealed as early as possible. When CI failures or integration errors are reported, existing techniques are insufficient to automatically locate the root causes for two reasons. First, a CI failure may be triggered by faults in source code and/or build scripts, whereas current approaches consider only source code. Second, a tentative integration can fail because of build failures and/or test failures, whereas existing tools focus on test failures only. This article presents UniLoc, the first unified technique to localize faults in both source code and build scripts given a CI failure log, without assuming the failure’s location (source code or build scripts) and nature (a test failure or not). Adopting the information retrieval (IR) strategy, UniLoc locates buggy files by treating source code and build scripts as documents to search and by considering build logs as search queries. However, instead of naïvely applying an off-the-shelf IR technique to these software artifacts, for more accurate fault localization, UniLoc applies various domain-specific heuristics to optimize the search queries, search space, and ranking formulas. To evaluate UniLoc, we gathered 700 CI failure fixes in 72 open source projects that are built with Gradle. UniLoc could effectively locate bugs with the average mean reciprocal rank value as 0.49, mean average precision value as 0.36, and normalized discounted cumulative gain value as 0.54. UniLoc outperformed the state-of-the-art IR-based tool BLUiR and Locus. UniLoc has the potential to help developers diagnose root causes for CI failures more accurately and efficiently.