当前位置: X-MOL 学术Empir. Software Eng. › 论文详情
Our official English website, www.x-mol.net, welcomes your feedback! (Note: you will need to create a separate account there.)
Assessing exception handling testing practices in open-source libraries
Empirical Software Engineering ( IF 3.5 ) Pub Date : 2021-06-22 , DOI: 10.1007/s10664-021-09983-3
Luan P. Lima , Lincoln S. Rocha , Carla I. M. Bezerra , Matheus Paixao

Modern programming languages (e.g., Java and C#) provide features to separate error-handling code from regular code, seeking to enhance software comprehensibility and maintainability. Nevertheless, the way exception handling (EH) code is structured in such languages may lead to multiple, different, and complex control flows, which may affect the software testability. Previous studies have reported that EH code is typically neglected, not well tested, and its misuse can lead to reliability degradation and catastrophic failures. However, little is known about the relationship between testing practices and EH testing effectiveness. In this exploratory study, we (i) measured the adequacy degree of EH testing concerning code coverage (instruction, branch, and method) criteria; and (ii) evaluated the effectiveness of the EH testing by measuring its capability to detect artificially injected faults (i.e., mutants) using 7 EH mutation operators. Our study was performed using test suites of 27 long-lived Java libraries from open-source ecosystems. Our results show that instructions and branches within catch blocks and throw instructions are less covered, with statistical significance, than the overall instructions and branches. Nevertheless, most of the studied libraries presented test suites capable of detecting more than 70% of the injected faults. From a total of 12,331 mutants created in this study, the test suites were able to detect 68% of them.



中文翻译:

评估开源库中的异常处理测试实践

现代编程语言(例如 Java 和 C#)提供了将错误处理代码与常规代码分开的功能,旨在增强软件的可理解性和可维护性。然而,异常处理 (EH) 代码在此类语言中的结构方式可能会导致多个、不同且复杂的控制流,这可能会影响软件的可测试性。先前的研究报告称,EH 代码通常被忽视,未经充分测试,其误用会导致可靠性下降和灾难性故障。然而,人们对测试实践和 EH 测试有效性之间的关系知之甚少。在这项探索性研究中,我们 (i) 测量了 EH 测试在代码覆盖率(指令、分支和方法)标准方面的充分程度;(ii) 通过使用 7 个 EH 突变算子测量其检测人工注入故障(即突变体)的能力来评估 EH 测试的有效性。我们的研究是使用来自开源生态系统的 27 个长期存在的 Java 库的测试套件进行的。我们的结果表明指令和分支与整体指令和分支相比,catch块和throw指令的覆盖率较低,具有统计意义。尽管如此,大多数研究的库都提供了能够检测超过 70 %的注入故障的测试套件。在本研究中创建的总共 12,331 个突变体中,测试套件能够检测到其中的 68 %

更新日期:2021-06-22
down
wechat
bug