Automatically identifying focal methods under test in unit test cases

Mohammad Ghafari, C. Ghezzi, K. Rubinov
{"title":"Automatically identifying focal methods under test in unit test cases","authors":"Mohammad Ghafari, C. Ghezzi, K. Rubinov","doi":"10.1109/SCAM.2015.7335402","DOIUrl":null,"url":null,"abstract":"Modern iterative and incremental software development relies on continuous testing. The knowledge of test-to-code traceability links facilitates test-driven development and improves software evolution. Previous research identified traceability links between test cases and classes under test. Though this information is helpful, a finer granularity technique can provide more useful information beyond the knowledge of the class under test. In this paper, we focus on Java classes that instantiate stateful objects and propose an automated technique for precise detection of the focal methods under test in unit test cases. Focal methods represent the core of a test scenario inside a unit test case. Their main purpose is to affect an object's state that is then checked by other inspector methods whose purpose is ancillary and needs to be identified as such. Distinguishing focal from other (non-focal) methods is hard to accomplish manually. We propose an approach to detect focal methods under test automatically. An experimental assessment with real-world software shows that our approach identifies focal methods under test in more than 85% of cases, providing a ground for precise automatic recovery of test-to-code traceability links.","PeriodicalId":192232,"journal":{"name":"2015 IEEE 15th International Working Conference on Source Code Analysis and Manipulation (SCAM)","volume":"17 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2015-11-23","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"32","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"2015 IEEE 15th International Working Conference on Source Code Analysis and Manipulation (SCAM)","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1109/SCAM.2015.7335402","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 32

Abstract

Modern iterative and incremental software development relies on continuous testing. The knowledge of test-to-code traceability links facilitates test-driven development and improves software evolution. Previous research identified traceability links between test cases and classes under test. Though this information is helpful, a finer granularity technique can provide more useful information beyond the knowledge of the class under test. In this paper, we focus on Java classes that instantiate stateful objects and propose an automated technique for precise detection of the focal methods under test in unit test cases. Focal methods represent the core of a test scenario inside a unit test case. Their main purpose is to affect an object's state that is then checked by other inspector methods whose purpose is ancillary and needs to be identified as such. Distinguishing focal from other (non-focal) methods is hard to accomplish manually. We propose an approach to detect focal methods under test automatically. An experimental assessment with real-world software shows that our approach identifies focal methods under test in more than 85% of cases, providing a ground for precise automatic recovery of test-to-code traceability links.
查看原文
分享 分享
微信好友 朋友圈 QQ好友 复制链接
本刊更多论文
在单元测试用例中自动识别测试中的焦点方法
现代迭代和增量软件开发依赖于持续的测试。测试到代码的可追溯性链接的知识促进了测试驱动的开发,并改进了软件的发展。先前的研究确定了测试用例和被测试类之间的可追溯性链接。虽然这些信息很有帮助,但是更细粒度的技术可以提供更多有用的信息,而不仅仅是被测类的知识。在本文中,我们将重点放在实例化有状态对象的Java类上,并提出一种自动化技术,用于在单元测试用例中精确检测被测试的重点方法。焦点方法表示单元测试用例中测试场景的核心。它们的主要目的是影响对象的状态,然后由其他检查器方法检查,这些检查器方法的目的是辅助的,需要被识别出来。将焦点与其他(非焦点)方法区分开来很难手动完成。提出了一种自动检测被测焦点方法的方法。对真实世界软件的实验评估表明,我们的方法在超过85%的情况下识别了测试中的焦点方法,为测试到代码的可追溯性链接的精确自动恢复提供了基础。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 去求助
来源期刊
自引率
0.00%
发文量
0
期刊最新文献
FaultBuster: An automatic code smell refactoring toolset On the comprehension of code clone visualizations: A controlled study using eye tracking The impact of cross-distribution bug duplicates, empirical study on Debian and Ubuntu The use of C++ exception handling constructs: A comprehensive study CodeMetropolis: Eclipse over the city of source code
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
现在去查看 取消
×
提示
确定
0
微信
客服QQ
Book学术公众号 扫码关注我们
反馈
×
意见反馈
请填写您的意见或建议
请填写您的手机或邮箱
已复制链接
已复制链接
快去分享给好友吧!
我知道了
×
扫码分享
扫码分享
Book学术官方微信
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术
文献互助 智能选刊 最新文献 互助须知 联系我们:info@booksci.cn
Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。
Copyright © 2023 Book学术 All rights reserved.
ghs 京公网安备 11010802042870号 京ICP备2023020795号-1