Generating TCP/UDP network data for automated unit test generation

Generating TCP/UDP network data for automated unit test generation
复制标题

生成 TCP/UDP 网络数据以自动生成单元测试

DOI:
10.1145/2786805.2786828
复制
发表时间:
2015
期刊:
--
影响因子:
--
通讯作者:
Arcuri A
Arcuri A
中科院分区:
--
文献类型:
--
作者:
Arcuri A

文献摘要

参考文献

被引文献

相似文献

尽管自动化的单元测试生成技术在原则上可以生成实现高代码覆盖率的测试套件,但在实践中,这通常被被测代码对外部资源的依赖性所抑制。特别是,现代编程语言中的一个常见问题是由涉及网络(例如,打开TCP侦听端口)的代码引起的。为了为这样的代码生成测试,我们描述了一种模拟(模拟)Java标准库的网络接口的方法,这样基于搜索的测试生成器就可以将网络视为测试输入空间的一部分。这样做的好处不仅在于它克服了测试网络代码的许多限制(例如,不同的测试绑定到相同的本地端口,以及主机名和临时端口的确定性解析),而且还大大增加了代码覆盖率。对来自110个开源项目的23,886个类(总共超过660万行Java代码)的评估显示,有2,642个类(11%)发生了网络访问。作为EVOSUITE测试工具的一部分,我们对所建议的技术的实现处理了这些类中包含的1,672(63%)个网络代码,并导致平均行覆盖率从29.1%增加到50.8%。在手工选择42个严重依赖网络的Java类时,使用网络模拟,EVOSUITE的行覆盖率增加了一倍多,从31.8%增加到76.6%。
Although automated unit test generation techniques can in principle generate test suites that achieve high code coverage, in practice this is often inhibited by the dependence of the code under test on external resources. In particular, a common problem in modern programming languages is posed by code that involves networking (e.g., opening a TCP listening port). In order to generate tests for such code, we describe an approach where we mock (simulate) the networking interfaces of the Java standard library, such that a search-based test generator can treat the network as part of the test input space. This not only has the benefit that it overcomes many limitations of testing networking code (e.g., different tests binding to the same local ports, and deterministic resolution of hostnames and ephemeral ports), it also substantially increases code coverage. An evaluation on 23,886 classes from 110 open source projects, totalling more than 6.6 million lines of Java code, reveals that network access happens in 2,642 classes (11%). Our implementation of the proposed technique as part of the EVOSUITE testing tool addresses the networking code contained in 1,672 (63%) of these classes, and leads to an increase of the average line coverage from 29.1% to 50.8%. On a manual selection of 42 Java classes heavily depending on networking, line coverage with EVOSUITE more than doubled with the use of network mocking, increasing from 31.8% to 76.6%.
DOI: 10.1145/1858996.1859053
发表时间: 2010-09
期刊: Proceedings of the 25th IEEE/ACM International Conference on Automated Software Engineering
影响因子: --
作者:
Kunal Taneja;Yi Zhang;Tao Xie
通讯作者: Kunal Taneja;Yi Zhang;Tao Xie
DOI: 10.1109/icst.2010.54
发表时间: 2010-04
期刊: 2010 Third International Conference on Software Testing, Verification and Validation
影响因子: --
作者:
L. Baresi;P. Lanzi;Matteo Miraz
通讯作者: L. Baresi;P. Lanzi;Matteo Miraz
字节码检测和源代码检测一样好吗:工业工具的实证研究(经验报告)
DOI: --
发表时间: 2013
期刊: IEEE International Symposium on Software Reliability Engineering
影响因子: --
作者:
Nan Li;Xin Meng;A. Offutt;Lin Deng
通讯作者: Lin Deng
学术 HPC 集群的管理:UL 经验
DOI: --
发表时间: 2014
期刊: International Symposium on High Performance Computing Systems and Applications
影响因子: --
作者:
Sébastien Varrette;P. Bouvry;Hyacinthe Cartiaux;F. Georgatos
通讯作者: F. Georgatos
Moles:工具辅助的环境隔离与封闭
DOI: --
发表时间: 2010
期刊: International Conference on Software Technology: Methods and Tools
影响因子: --
作者:
J. D. Halleux;N. Tillmann
通讯作者: N. Tillmann