Extracting Inline Tests from Unit Tests

Extracting Inline Tests from Unit Tests
复制标题

从单元测试中提取内联测试

DOI:
10.1145/3597926.3598149
复制
发表时间:
2023
期刊:
ACM
影响因子:
--
通讯作者:
Legunsen, Owolabi
Legunsen, Owolabi
中科院分区:
--
文献类型:
--
作者:
Liu, Yu;Nie, Pengyu;Guo, Anna;Gligoric, Milos;Legunsen, Owolabi

文献摘要

参考文献

被引文献

相似文献

我们最近提出了用于验证单个程序语句的内联测试;它们允许开发人员在目标语句之后立即提供测试输入、预期输出和测试预言机。但是,现有代码可以有许多目标语句。因此,自动生成内联测试是提高其采用率的重要下一步。我们提出ExLi,第一种自动生成内联测试的技术。ExLi从单元测试中提取内联测试;它首先在执行单元测试时记录目标语句中的所有变量值。然后,ExLi使用这些值作为测试输入,并在初始的一组生成的内联测试中测试预言机。多次执行的目标语句可能具有冗余的初始内联测试。因此,ExLi使用了一种新的基于覆盖率然后突变的约简过程来删除冗余的内联测试。我们实现了ExLi for Java,并使用它来生成31个开源程序中的718个目标语句的内联测试。ExLi将最初生成的17,273个内联测试减少到905个内联测试。最终生成的内联测试比开发人员编写和自动生成的单元测试多杀死25.1%的目标语句突变体。也就是说,ExLi生成的内联测试可以提高测试套件的故障检测能力,这些测试套件是从中提取的。
We recently proposed inline tests for validating individual program statements; they allow developers to provide test inputs, expected outputs, and test oracles immediately after a target statement. But, existing code can have many target statements. So, automatic generation of inline tests is an important next step towards increasing their adoption. We propose ExLi, the first technique for automatically generating inline tests. ExLi extracts inline tests from unit tests; it first records all variable values at a target statement while executing unit tests. Then, ExLi uses those values as test inputs and test oracles in an initial set of generated inline tests. Target statements that are executed many times could have redundant initial inline tests. So, ExLi uses a novel coverage-then-mutants based reduction process to remove redundant inline tests. We implement ExLi for Java and use it to generate inline tests for 718 target statements in 31 open-source programs. ExLi reduces 17,273 initially generated inline tests to 905 inline tests. The final set of generated inline tests kills up to 25.1% more mutants on target statements than developer written and automatically generated unit tests. That is, ExLi generates inline tests that can improve the fault-detection capability of the test suites from which they are extracted.
Nemo:使用整数非线性规划的多标准测试套件最小化
DOI: --
发表时间: 2018
期刊: International Conference on Software Engineering
影响因子: --
作者:
Jun;Reyhaneh Jabbarvand;Joshua Garcia;S. Malek
通讯作者: S. Malek
从 daikon 到 agitator:构建用于开发人员测试的商业工具的经验教训和挑战
DOI: 10.1145/1146238.1146258
发表时间: 2006
期刊: 2007 IEEE Congress on Evolutionary Computation
影响因子: --
作者:
Marat Boshernitsan;Roong;A. Savoia
通讯作者: A. Savoia
测试套件最小化技术的评估
DOI: --
发表时间: 2019
期刊: International Conference on Software Quality. Process Automation in Software Development
影响因子: --
作者:
Raphael Noemmer;Roman Haas
通讯作者: Roman Haas
统一命令式生成器和声明性规范的执行
DOI: 10.1145/3428285
发表时间: 2020
影响因子: --
作者:
Nie, Pengyu;Parovic, Marinela;Zang, Zhiqiang;Khurshid, Sarfraz;Milicevic, Aleksandar;Gligoric, Milos
通讯作者: Gligoric, Milos
DOI: 10.1145/3551349.3556952
发表时间: 2022-09
期刊: Proceedings of the 37th IEEE/ACM International Conference on Automated Software Engineering
影响因子: --
作者:
Yu Liu;Pengyu Nie;Owolabi Legunsen;Miloš Gligorić
通讯作者: Yu Liu;Pengyu Nie;Owolabi Legunsen;Miloš Gligorić