[论文解读] IBIR: Bug Report driven Fault Injection
iBiR 是一种故障注入工具,通过从用户报告的错误报告中逆向工程代码修复模板,生成真实且有针对性的软件故障,从而实现对真实世界缺陷的精确模拟。其故障耦合率与真实错误达到36%,远超传统变异测试的50倍以上,同时保持与原始故障的高度语义相似性。
Much research on software engineering and software testing relies on experimental studies based on fault injection. Fault injection, however, is not often relevant to emulate real-world software faults since it "blindly" injects large numbers of faults. It remains indeed challenging to inject few but realistic faults that target a particular functionality in a program. In this work, we introduce IBIR, a fault injection tool that addresses this challenge by exploring change patterns associated to user-reported faults. To inject realistic faults, we create mutants by retargeting a bug report driven automated program repair system, i.e., reversing its code transformation templates. IBIR is further appealing in practice since it requires deep knowledge of neither of the code nor the tests, but just of the program's relevant bug reports. Thus, our approach focuses the fault injection on the feature targeted by the bug report. We assess IBIR by considering the Defects4J dataset. Experimental results show that our approach outperforms the fault injection performed by traditional mutation testing in terms of semantic similarity with the original bug, when applied at either system or class levels of granularity, and provides better, statistically significant, estimations of test effectiveness (fault detection). Additionally, when injecting 100 faults, IBIR injects faults that couple with the real ones in 36% of the cases, while mutants from mutation testing inject less than 1%. Overall, IBIR targets real functionality and injects realistic and diverse faults.
研究动机与目标
- 解决传统故障注入技术在代码库中盲目注入语法变异所导致的缺乏真实感问题。
- 通过聚焦实际用户报告的错误及其修复模式,提升故障的代表性。
- 通过针对错误报告中描述的特定功能进行注入,降低故障注入的成本并提高其相关性。
- 提供一种实用且低开销的故障注入方法,无需深入了解系统的源代码或测试套件。
提出的方法
- iBiR 使用基于信息检索(IR)的故障定位技术,识别给定错误报告中提及的代码位置。
- 从修复系统(如 Nopol)中逆向工程修复模板,生成与实际修复方式一致的逼真故障模式。
- 通过反向应用这些修复转换操作,实现故障注入,生成模拟真实故障的变异体。
- 根据真实错误修复中故障模式的频率和位置对故障模式进行优先级排序,确保多样性和真实性。
- 在系统级或类级别粒度下运行,每个目标错误报告注入100个故障,以确保统计可靠性。
- 该方法仅需访问错误报告,无需源代码或测试套件,因而具有广泛的适用性。
实验结果
研究问题
- RQ1基于错误报告的故障注入是否能生成与真实故障具有更高语义相似度的变异体,优于传统变异测试?
- RQ2iBiR 注入的故障与真实故障的耦合程度如何(即是否被相同的测试用例检测到)?
- RQ3与传统变异测试相比,iBiR 是否能更准确地估计测试有效性(故障检测)?
- RQ4iBiR 是否能在无需深入了解系统源代码或测试套件的前提下,生成多样化且逼真的故障?
主要发现
- iBiR 与真实故障的中位语义相似度达到 0.58,显著高于传统变异测试的 0.0。
- iBiR 注入的故障在 36% 的情况下与真实故障耦合,而传统变异测试低于 1%。
- iBiR 的故障耦合率约为传统变异测试的 50 倍,表明其与真实故障行为的对齐程度更强。
- iBiR 在估计测试有效性方面提供了统计上显著的改进,以故障检测率作为衡量指标。
- 该方法可在极少系统知识的前提下实现逼真的故障注入,仅依赖错误报告。
- iBiR 的方法支持受控实验,并可作为实证软件工程研究中真实故障的有效替代品。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。