Automated scheduling for clone-based refactoring using a competent GA

  • Authors:
  • Sukhee Lee;Gigon Bae;Heung Seok Chae;Doo-Hwan Bae;Yong Rae Kwon

  • Affiliations:
  • Department of Computer Science, College of Information Science and Technology, KAIST, 335 Gwahak-ro, Yuseong-gu, Daejeon, South Korea;Department of Computer Science, College of Information Science and Technology, KAIST, 335 Gwahak-ro, Yuseong-gu, Daejeon, South Korea;Pusan National University, Geumjeong-gu, Busan, South Korea;Department of Computer Science, College of Information Science and Technology, KAIST, 335 Gwahak-ro, Yuseong-gu, Daejeon, South Korea;Department of Computer Science, College of Information Science and Technology, KAIST, 335 Gwahak-ro, Yuseong-gu, Daejeon, South Korea

  • Venue:
  • Software—Practice & Experience
  • Year:
  • 2011

Quantified Score

Hi-index 0.00

Visualization

Abstract

Refactoring is a widely accepted technique to improve the software quality by restructuring its design without changing its behavior. In general, a sequence of refactorings needs to be applied until the quality of the code is improved satisfactorily. In this case, the final design after refactoring can vary with the application order of refactorings, thereby producing different quality improvements. Therefore, it is necessary to determine a proper refactoring schedule to obtain as many benefits as possible. However, there is little research on the problem of generating appropriate schedules to maximize quality improvement. In this paper, we propose an approach to automatically determine an appropriate schedule to maximize quality improvement through refactoring. We first detect code clones that are suitable for refactoring and generate the most beneficial refactoring schedule to remove them. It is straightforward to select the best from the exhaustively enumerated schedules. However, such a technique becomes NP-hard, as the number of available refactorings increases. We apply a genetic algorithm (GA) to generate the best refactoring schedule within a reasonable time to cope with this problem. We compare the GA-based approach with manual scheduling, greedy heuristic-based, and exhaustive approaches for four open systems. The results show that the proposed GA-based approach generates more beneficial schedules than the others. Copyright © 2010 John Wiley & Sons, Ltd.