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

增量构建中的构建依赖错误检测

Detecting Build Dependency Errors in Incremental Builds

Jun Lyu, Shanshan Li, He Zhang, Yang Zhang, Guoping Rong, Manuel Rigger

AI总结:

提出 EChecker 方法,通过从 C/C++ 预处理器指令和 Makefile 更改中推断依赖关系,在增量构建中检测构建依赖错误,避免了昂贵的干净构建,在保持有效性的同时将检测效率平均提高 85.14 倍且 F-1 分数提升 0.18。

摘要:

由 Make 等构建工具执行的增量构建和并行构建是现代 C/C++ 软件项目的核心。它们的正确和高效执行依赖于构建脚本。然而,构建脚本很容易出错。最常见的错误是缺失依赖(MDs)和冗余依赖(RDs)。检测这些错误的最先进方法依赖于干净构建(即在干净环境中对软件配置子集进行完整构建),这成本高昂,对于大型项目可能需要数小时。为了应对这些挑战,我们提出了一种名为 EChecker 的新方法,用于在增量构建的上下文中检测构建依赖错误。EChecker 的核心思想是通过从 C/C++ 预处理器指令和新提交中的 Makefile 更改来推断,自动更新实际的构建依赖,从而尽可能避免干净构建。EChecker 比依赖干净构建的方法实现了更高的效率,同时保持了有效性。我们选择了 12 个代表性项目,规模从小到大,包含 240 次提交(每个项目 20 次提交),基于此我们评估了 EChecker 的有效性和效率。我们将评估结果与最先进的构建依赖错误检测工具进行了比较。评估显示,EChecker 的 F-1 分数比最先进方法提高了 0.18。EChecker 将构建依赖错误检测效率平均提高了 85.14 倍(中位数为 16.30 倍)。结果表明,EChecker 能够支持从业者高效地检测构建依赖错误。

英文摘要:

Incremental and parallel builds performed by build tools such as Make are the heart of modern C/C++ software projects. Their correct and efficient execution depends on build scripts. However, build scripts are prone to errors. The most prevalent errors are missing dependencies (MDs) and redundant dependencies (RDs). The state-of-the-art methods for detecting these errors rely on clean builds (i.e., full builds of a subset of software configurations in a clean environment), which is costly and takes up to multiple hours for large-scale projects. To address these challenges, we propose a novel approach called EChecker to detect build dependency errors in the context of incremental builds. The core idea of EChecker is to automatically update actual build dependencies by inferring them from C/C++ pre-processor directives and Makefile changes from new commits, which avoids clean builds when possible. EChecker achieves higher efficiency than the methods that rely on clean builds while maintaining effectiveness. We selected 12 representative projects, with their sizes ranging from small to large, with 240 commits (20 commits for each project), based on which we evaluated the effectiveness and efficiency of EChecker. We compared the evaluation results with a state-of-the-art build dependency error detection tool. The evaluation shows that the F-1 score of EChecker improved by 0.18 over the state-of-the-art method. EChecker increases the build dependency error detection efficiency by an average of 85.14 times (with the median at 16.30 times). The results demonstrate that EChecker can support practitioners in detecting build dependency errors efficiently.

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

↑