单元测试的重构后恢复:一种自动化的方法

A. Qusef, Sharefa Murad, N. Alsalhi, E. A. Shudayfat
{"title":"单元测试的重构后恢复:一种自动化的方法","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":"{\"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}","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

摘要

在应用程序开发生命周期中,特别是在测试驱动的开发中,重构在维持易用性方面起着至关重要的作用。然而,尽管带来了便利,重构并不能确保应用代码后的预期行为。因为重构往往会使源代码与其对应单元之间的一致性恶化。上述问题的一个重要解决方案是称为单元测试的技术。单元测试使开发人员能够自信地应用重构,同时避免不必要的代码行为。单元测试通过提供即时反馈,为避免bug提供了有效的预防措施,从而有助于减轻对变更的恐惧。在这项工作中,我们提出了一个名为GreenRefPlus的工具,它可以有效地使开发人员在应用重构过程后维护代码的准确性。建议的工具在代码重构后为单元测试提供自动恢复。在这项工作中,我们将Java作为我们的目标编程语言,重点关注五种不同类型的重构,包括重命名方法、提取方法、移动方法、参数添加和参数删除。我们的实验表明,建议的工具GreenRefPlus使我们能够一致地重构代码并应用单元测试。在我们的工作中显示的结果表明,所建议的工具帮助开发人员节省了大约43%的从损坏的单元测试中手动恢复所需的总时间。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
查看原文
分享 分享
微信好友 朋友圈 QQ好友 复制链接
本刊更多论文
Post-Refactoring Recovery of Unit Tests: An Automated Approach
— 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.
求助全文
通过发布文献求助,成功后即可免费获取论文全文。 去求助
来源期刊
自引率
0.00%
发文量
0
期刊最新文献
ESPE Security: Mobile and Web Application to Manage Community Emergency Alerts Improving Chemical Literacy Skills: Integrated Socio-Scientific Issues Content in Augmented Reality Mobile Alternative Framework in Electrochemistry among Secondary Schools Students in Johor, Malaysia Empowering Safety-Conscious Women Travelers: Examining the Benefits of Electronic Word of Mouth and Mobile Travel Assistant Enhancing Metacognitive and Creativity Skills through AI-Driven Meta-Learning Strategies
×
引用
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