Automated Detection of Test Fixture Strategies and Smells

Michaela Greiler, A. Deursen, M. Storey
{"title":"Automated Detection of Test Fixture Strategies and Smells","authors":"Michaela Greiler, A. Deursen, M. Storey","doi":"10.1109/ICST.2013.45","DOIUrl":null,"url":null,"abstract":"Designing automated tests is a challenging task. One important concern is how to design test fixtures, i.e. code that initializes and configures the system under test so that it is in an appropriate state for running particular automated tests. Test designers may have to choose between writing in-line fixture code for each test or refactor fixture code so that it can be reused for other tests. Deciding on which approach to use is a balancing act, often trading off maintenance overhead with slow test execution. Additionally, over time, test code quality can erode and test smells can develop, such as the occurrence of overly general fixtures, obscure in-line code and dead fields. In this paper, we show that test smells related to fixture set-up occur in industrial projects. We present a static analysis technique to identify fixture related test smells. We implemented this test analysis technique in a tool, called TestHound, which provides reports on test smells and recommendations for refactoring the smelly test code. We evaluate the tool through three industrial case studies and show that developers find that the tool helps them to understand, reflect on and adjust test code.","PeriodicalId":331232,"journal":{"name":"2013 IEEE Sixth International Conference on Software Testing, Verification and Validation","volume":"45 4 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2013-03-18","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"87","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"2013 IEEE Sixth International Conference on Software Testing, Verification and Validation","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1109/ICST.2013.45","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 87

Abstract

Designing automated tests is a challenging task. One important concern is how to design test fixtures, i.e. code that initializes and configures the system under test so that it is in an appropriate state for running particular automated tests. Test designers may have to choose between writing in-line fixture code for each test or refactor fixture code so that it can be reused for other tests. Deciding on which approach to use is a balancing act, often trading off maintenance overhead with slow test execution. Additionally, over time, test code quality can erode and test smells can develop, such as the occurrence of overly general fixtures, obscure in-line code and dead fields. In this paper, we show that test smells related to fixture set-up occur in industrial projects. We present a static analysis technique to identify fixture related test smells. We implemented this test analysis technique in a tool, called TestHound, which provides reports on test smells and recommendations for refactoring the smelly test code. We evaluate the tool through three industrial case studies and show that developers find that the tool helps them to understand, reflect on and adjust test code.
测试夹具策略和气味的自动检测
设计自动化测试是一项具有挑战性的任务。一个重要的问题是如何设计测试装置,即初始化和配置被测系统的代码,以便它处于运行特定自动化测试的适当状态。测试设计人员可能不得不在为每个测试编写内联固定代码或重构固定代码之间做出选择,以便可以在其他测试中重用它。决定使用哪种方法是一种平衡行为,通常需要在维护开销和缓慢的测试执行之间进行权衡。此外,随着时间的推移,测试代码的质量可能会下降,测试气味可能会产生,比如出现过于通用的fixture、模糊的内联代码和死域。在本文中,我们证明了与夹具设置相关的测试气味发生在工业项目中。我们提出了一种静态分析技术来识别夹具相关的测试气味。我们在一个名为TestHound的工具中实现了这种测试分析技术,该工具提供了关于测试气味的报告和重构有气味的测试代码的建议。我们通过三个工业案例研究来评估该工具,并表明开发人员发现该工具可以帮助他们理解、反思和调整测试代码。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约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学术文献互助群
群 号:604180095
Book学术官方微信
小红书