Post-Refactoring Recovery of Unit Tests: An Automated Approach

Authors

  • Abdallah Qusef Princess Sumaya University for Technology, Amman-Jordan
  • Sharefa Murad
  • Najeh Alsalhi Humanities and Social Sciences Research Center, Ajman University, Ajman, UAE
  • Eman Shudayfat Department of Creative media, Luminus Technical University College, Amman, Jordan.

DOI:

https://doi.org/10.3991/ijim.v17i08.38785

Keywords:

Unit Tests, GreenRefPlus, Code Refactoring, Automatic Recovery, JUnit, Eclipse Plug-in, Agile eXtreme Programming, Test-Driven Development.

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.

Downloads

Published

2023-04-26

How to Cite

Abdallah Qusef, Murad, S., Najeh Alsalhi, & Eman Shudayfat. (2023). Post-Refactoring Recovery of Unit Tests: An Automated Approach. International Journal of Interactive Mobile Technologies (iJIM), 17(08), pp. 39–58. https://doi.org/10.3991/ijim.v17i08.38785

Issue

Section

Papers