Generating Unit Tests with Structured System Interactions

Nikolas Havrikov, Alessio Gambi, A. Zeller, Andrea Arcuri, Juan P. Galeotti
{"title":"Generating Unit Tests with Structured System Interactions","authors":"Nikolas Havrikov, Alessio Gambi, A. Zeller, Andrea Arcuri, Juan P. Galeotti","doi":"10.1109/AST.2017.2","DOIUrl":null,"url":null,"abstract":"There is a large body of work in the literature about automatic unit tests generation, and many successful results have been reported so far. However, current approaches target library classes, but not full applications. A major obstacle for testing full applications is that they interact with the environment. For example, they access files on the hard drive or establish connections to remote servers. Thoroughly testing such applications requires tests that completely control the interactions between the application and its environment. Recent techniques based on mocking enable the generation of tests which include environment interactions, however, generating the right type of interactions is still an open problem. In this paper, we describe a novel approach which addresses this problem by enhancing search-based testing with complex test data generation. Experiments on an artificial system show that the proposed approach can generate effective unit tests. Compared with current techniques based on mocking, we generate more robust unit tests which achieve higher coverage and are, arguably, easier to read and understand.","PeriodicalId":141557,"journal":{"name":"2017 IEEE/ACM 12th International Workshop on Automation of Software Testing (AST)","volume":"10 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2017-05-20","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"4","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"2017 IEEE/ACM 12th International Workshop on Automation of Software Testing (AST)","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1109/AST.2017.2","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 4

Abstract

There is a large body of work in the literature about automatic unit tests generation, and many successful results have been reported so far. However, current approaches target library classes, but not full applications. A major obstacle for testing full applications is that they interact with the environment. For example, they access files on the hard drive or establish connections to remote servers. Thoroughly testing such applications requires tests that completely control the interactions between the application and its environment. Recent techniques based on mocking enable the generation of tests which include environment interactions, however, generating the right type of interactions is still an open problem. In this paper, we describe a novel approach which addresses this problem by enhancing search-based testing with complex test data generation. Experiments on an artificial system show that the proposed approach can generate effective unit tests. Compared with current techniques based on mocking, we generate more robust unit tests which achieve higher coverage and are, arguably, easier to read and understand.
使用结构化系统交互生成单元测试
在关于自动单元测试生成的文献中有大量的工作,到目前为止已经报道了许多成功的结果。然而,目前的方法针对库类,而不是完整的应用程序。测试完整应用程序的一个主要障碍是它们与环境交互。例如,它们访问硬盘上的文件或与远程服务器建立连接。彻底测试这类应用程序需要完全控制应用程序与其环境之间交互的测试。最近基于模拟的技术能够生成包含环境交互的测试,然而,生成正确类型的交互仍然是一个有待解决的问题。在本文中,我们描述了一种新的方法,该方法通过复杂的测试数据生成来增强基于搜索的测试。在一个人工系统上的实验表明,该方法可以生成有效的单元测试。与当前基于模拟的技术相比,我们生成了更健壮的单元测试,这些测试实现了更高的覆盖率,并且更容易阅读和理解。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术官方微信