Exploring the Triggering Modes of Spectrum-Based Fault Localization: An Industrial Case

Exploring the Triggering Modes of Spectrum-Based Fault Localization: An Industrial Case
复制标题

DOI:
10.1109/icst49551.2021.00052
复制
发表时间:
2021-04
期刊:
2021 14th IEEE Conference on Software Testing, Verification and Validation (ICST)
影响因子:
--
通讯作者:
Tung Dao;Max Wang;Na Meng
Tung Dao;Max Wang;Na Meng
中科院分区:
其他
文献类型:
--
作者:
Tung Dao;Max Wang;Na Meng

文献摘要

相似文献

故障定位是软件开发和维护的重要环节。在现有的技术中,基于频谱的故障定位(SBFL)是有效的定位错误的执行覆盖率的基础上通过和失败的测试。然而,目前的SBFL工具要求在建议任何可疑位置的排名列表之前执行所有测试。实际上,这种全测试执行非常耗时; SBFL基于全套件执行的输出会显著延迟开发人员的调试活动并危及其生产力。对于本文,我们很好奇是否可以在看到一个或多个测试失败后立即应用SBFL,而不是等待所有测试完成运行。具体来说,28注入的错误和13个真实的错误在一个封闭的源代码软件产品,我们收集了每个测试用例的语句级覆盖率,并调查了25个替代SBFL公式的使用。我们以五种模式触发SBFL:(i)第一次测试失败后,(ii)第一次失败和一些额外的通过测试后,(iii)每次测试失败后,(iv)在指定的时间间隔(例如,每2分钟),或(v)在所有测试完成后。我们的研究显示了有趣的结果。与整套执行相比,基于部分执行提前触发SBFL公式,可以更有效地定位bug。在这五种模式中,第一种故障驱动模式的效果最好。此外,我们对Defects4J数据集中的57个真实的bug进行了类似的实验,并观察到了类似的现象。我们的观察意味着,而不是等待完成所有的测试运行,这是很有希望的应用SBFL公式后,立即初始测试失败。通过这种方式,开发人员有可能在更短的时间内获得更好的建议。我们的研究将帮助开发人员更好地在实践中采用SBFL。
Fault localization is important for software development and maintenance. Among existing techniques, spectrum-based fault localization (SBFL) is effective to locate bugs based on the execution coverage of passed and failed tests. However, current SBFL tools require the execution of all tests before suggesting any ranked list of suspicious locations. In reality, such all-test execution can be very time-consuming; SBFL’s outputs based on the whole-suite execution can significantly delay developers’ debugging activities and jeopardize their productivity.For this paper, we were curious whether we can apply SBFL immediately after seeing one or several test failures, instead of waiting for all tests to finish their run. Specifically, with 28 injected bugs and 13 real bugs in a close-sourced software product, we collected the statement-level coverage for each test case, and investigated the usage of 25 alternative SBFL formulas. We triggered SBFL in five modes: (i) after the first test failure, (ii) after the first failure and some extra passed tests, (iii) after every test failure, (iv) at a specified time interval (e.g., every 2 minutes), or (v) after the complete execution of all tests.Our study shows interesting results. Compared with whole-suite execution, triggering SBFL formulas earlier based on partial execution helps locate bugs more effectively. Among the five modes, the first-failure-driven mode works best. Additionally, we conducted similar experiments on 57 real bugs from the Defects4J dataset and observed similar phenomena. Our observations imply that instead of waiting for the completion of all test runs, it is quite promising to apply SBFL formulas immediately after the initial test failure. In this way, developers are likely to get better suggestions within a shorter period of time. Our research will help developers better adopt SBFL in practice.