Post-Refactoring Recovery of Unit Tests: An Automated Approach

A. Qusef, Sharefa Murad, N. Alsalhi, E. A. Shudayfat
{"title":"Post-Refactoring Recovery of Unit Tests: An Automated Approach","authors":"A. Qusef, Sharefa Murad, N. Alsalhi, E. A. Shudayfat","doi":"10.3991/ijim.v17i08.38785","DOIUrl":null,"url":null,"abstract":"— In application development lifecycle, specifically in test-driven development, refactoring plays a crucial role in sustaining ease. However, in-spite of bringing ease, refactoring does not ensure the desired behaviour of code after it is applied. Because refactoring tends to worsen the alignments between source code and its corresponding units. One significant solution to the aforementioned issue is the technique called unit testing. As unit testing enable the developers to confidently apply refactoring while avoiding undesired code behaviour. Unit testing provides effective preventive measures for avoiding bugs by providing immediate feedback, thus assisting to mitigate the fear of change. In this work, we present a tool called GreenRefPlus which efficiently enables the developers to maintain the veracity of code after the process of refactoring is applied. The proposed tool provides automatic recovery for the unit tests after the code is refactored. In this work, we consider Java as our target programming language and we focus on five various types of refactoring, which include Rename Method, Extract Method, Move Method, Parameter Addition and Parameter Removal. Our experiments indicate that the proposed tool GreenRefPlus enables us to consistently refactor the code and apply unit tests. The results presented in our work reveal that the proposed tool assists developers in saving approximately 43% of the total time required to manually recover from broken unit tests.","PeriodicalId":13648,"journal":{"name":"Int. J. Interact. Mob. Technol.","volume":null,"pages":null},"PeriodicalIF":0.0000,"publicationDate":"2023-04-26","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Int. J. Interact. Mob. Technol.","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.3991/ijim.v17i08.38785","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0

Abstract

— In application development lifecycle, specifically in test-driven development, refactoring plays a crucial role in sustaining ease. However, in-spite of bringing ease, refactoring does not ensure the desired behaviour of code after it is applied. Because refactoring tends to worsen the alignments between source code and its corresponding units. One significant solution to the aforementioned issue is the technique called unit testing. As unit testing enable the developers to confidently apply refactoring while avoiding undesired code behaviour. Unit testing provides effective preventive measures for avoiding bugs by providing immediate feedback, thus assisting to mitigate the fear of change. In this work, we present a tool called GreenRefPlus which efficiently enables the developers to maintain the veracity of code after the process of refactoring is applied. The proposed tool provides automatic recovery for the unit tests after the code is refactored. In this work, we consider Java as our target programming language and we focus on five various types of refactoring, which include Rename Method, Extract Method, Move Method, Parameter Addition and Parameter Removal. Our experiments indicate that the proposed tool GreenRefPlus enables us to consistently refactor the code and apply unit tests. The results presented in our work reveal that the proposed tool assists developers in saving approximately 43% of the total time required to manually recover from broken unit tests.
单元测试的重构后恢复:一种自动化的方法
在应用程序开发生命周期中,特别是在测试驱动的开发中,重构在维持易用性方面起着至关重要的作用。然而,尽管带来了便利,重构并不能确保应用代码后的预期行为。因为重构往往会使源代码与其对应单元之间的一致性恶化。上述问题的一个重要解决方案是称为单元测试的技术。单元测试使开发人员能够自信地应用重构,同时避免不必要的代码行为。单元测试通过提供即时反馈,为避免bug提供了有效的预防措施,从而有助于减轻对变更的恐惧。在这项工作中,我们提出了一个名为GreenRefPlus的工具,它可以有效地使开发人员在应用重构过程后维护代码的准确性。建议的工具在代码重构后为单元测试提供自动恢复。在这项工作中,我们将Java作为我们的目标编程语言,重点关注五种不同类型的重构,包括重命名方法、提取方法、移动方法、参数添加和参数删除。我们的实验表明,建议的工具GreenRefPlus使我们能够一致地重构代码并应用单元测试。在我们的工作中显示的结果表明,所建议的工具帮助开发人员节省了大约43%的从损坏的单元测试中手动恢复所需的总时间。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约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学术官方微信