Automatic Recovery of Unit Tests after Code Refactoring

Alaa Jaradat, A. Qusef
{"title":"Automatic Recovery of Unit Tests after Code Refactoring","authors":"Alaa Jaradat, A. Qusef","doi":"10.1109/ACIT47987.2019.8990974","DOIUrl":null,"url":null,"abstract":"Unit testing allows developers to refactor their code confidently, these tests act as a safety net against producing bugs and provide immediate feedback during the refactoring process and furthermore help developers overcome the fear of change. When performing refactoring, the design of code is changed or restructured according to a predefined plan, after refactoring is applied, the alignment between source code and its corresponding unit tests could be broken which creates a problem that needs to be solved.This paper introduces an approach in which code refactoring can maintain the integrity of the previous unit tests; the tool called GreenRef demonstrates this work. This tool supports an automatic recovery for the unit tests after performing of three particular refactoring types for Java programming language: Rename Method, Add Parameter and Remove Parameter.The achieved results indicate that GreenRef facilitates consistent use of refactoring and unit tests, and save about 43% of the time required to recover broken unit tests manually.","PeriodicalId":314091,"journal":{"name":"2019 International Arab Conference on Information Technology (ACIT)","volume":"1 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2019-12-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"2019 International Arab Conference on Information Technology (ACIT)","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1109/ACIT47987.2019.8990974","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0

Abstract

Unit testing allows developers to refactor their code confidently, these tests act as a safety net against producing bugs and provide immediate feedback during the refactoring process and furthermore help developers overcome the fear of change. When performing refactoring, the design of code is changed or restructured according to a predefined plan, after refactoring is applied, the alignment between source code and its corresponding unit tests could be broken which creates a problem that needs to be solved.This paper introduces an approach in which code refactoring can maintain the integrity of the previous unit tests; the tool called GreenRef demonstrates this work. This tool supports an automatic recovery for the unit tests after performing of three particular refactoring types for Java programming language: Rename Method, Add Parameter and Remove Parameter.The achieved results indicate that GreenRef facilitates consistent use of refactoring and unit tests, and save about 43% of the time required to recover broken unit tests manually.
代码重构后单元测试的自动恢复
单元测试允许开发人员自信地重构他们的代码,这些测试充当防止产生错误的安全网,并在重构过程中提供即时反馈,进一步帮助开发人员克服对更改的恐惧。在执行重构时,根据预先确定的计划更改或重构代码的设计,在应用重构后,源代码与其对应的单元测试之间的对齐可能会被破坏,从而产生需要解决的问题。本文介绍了一种代码重构方法,该方法可以保持先前单元测试的完整性;名为GreenRef的工具演示了这项工作。该工具支持在执行Java编程语言的三种特定重构类型(重命名方法、添加参数和删除参数)之后对单元测试进行自动恢复。获得的结果表明,GreenRef促进了重构和单元测试的一致使用,并节省了手动恢复损坏的单元测试所需的大约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学术官方微信