识别面向 Make 和 JVM 的构建中的缺陷
Identifying Bugs in Make and JVM-Oriented Builds
AI总结:
本文提出 buildfs 模型以建模构建操作规范与实际文件系统行为,形式化定义增量与并行构建中的故障,并通过分析单次完整构建自动发现缺陷,在 Make 和 Gradle 项目中验证了其有效性、高效性及对 Java 构建系统的首创支持。
摘要:
增量构建和并行构建是现代构建系统的关键特性。并行性通过同时运行相互独立的任务来实现快速构建,而增量性则通过只处理受特定代码变更影响的构建操作来节省时间和计算资源。编写能够产生无错误的增量构建和并行构建的构建定义是一项具有挑战性的任务。这主要是因为开发人员往往难以预测构建操作对文件系统的影响,以及不同构建操作之间如何相互作用。有缺陷的构建脚本可能严重降低自动化构建的可靠性,因为它们会导致构建失败、非确定性的构建结果以及错误的构建结果。为了对任意构建执行进行推理,我们提出了 buildfs,这是一个普遍适用的模型,它同时考虑了构建操作的规范(如构建脚本中所声明)和实际行为(底层文件系统操作)。然后,我们根据文件系统操作违反构建操作规范的条件,形式化地定义了与增量构建和并行构建相关的不同类型的故障。我们的测试方法依赖于所提出的模型,分析单次完整构建的执行过程,将其转换为 buildfs,并通过检查相应的违规情况来发现故障。我们通过检查数百个 Make 和 Gradle 项目来评估该方法的有效性、效率和适用性。值得注意的是,我们的方法是首个能够处理面向 Java 的构建系统的方法。结果表明,我们的方法(1)能够发现若干重要问题(在 45 个开源项目中发现的 245 个问题已得到上游开发者的确认和修复),并且(2)比面向 Make 构建的最先进工具快几个数量级。
英文摘要:
Incremental and parallel builds are crucial features of modern build systems. Parallelism enables fast builds by running independent tasks simultaneously, while incrementality saves time and computing resources by processing the build operations that were affected by a particular code change. Writing build definitions that lead to error-free incremental and parallel builds is a challenging task. This is mainly because developers are often unable to predict the effects of build operations on the file system and how different build operations interact with each other. Faulty build scripts may seriously degrade the reliability of automated builds, as they cause build failures, and non-deterministic and incorrect build results. To reason about arbitrary build executions, we present buildfs, a generally-applicable model that takes into account the specification (as declared in build scripts) and the actual behavior (low-level file system operation) of build operations. We then formally define different types of faults related to incremental and parallel builds in terms of the conditions under which a file system operation violates the specification of a build operation. Our testing approach, which relies on the proposed model, analyzes the execution of single full build, translates it into buildfs, and uncovers faults by checking for corresponding violations. We evaluate the effectiveness, efficiency, and applicability of our approach by examining hundreds of Make and Gradle projects. Notably, our method is the first to handle Java-oriented build systems. The results indicate that our approach is (1) able to uncover several important issues (245 issues found in 45 open-source projects have been confirmed and fixed by the upstream developers), and (2) orders of magnitude faster than a state-of-the-art tool for Make builds.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。