Automated method-extraction refactoring by using block-based slicing

  • Authors:
  • Katsuhisa Maruyama

  • Affiliations:
  • Department of Computer Science, Ritsumeikan University, 1-1-1 Noji-higashi Kusatsu Shiga 525-8577, Japan

  • Venue:
  • SSR '01 Proceedings of the 2001 symposium on Software reusability: putting software reuse in context
  • Year:
  • 2001

Quantified Score

Hi-index 0.00

Visualization

Abstract

Refactoring improves the design of existing code but is not complex to do by hand. This paper proposes a mechanism that automatically refactors methods of object-oriented programs by using program slicing. To restructure a method without changing its observable behavior, the mechanism uses block-based slicing that does not extract the fragments of code from the whole program but from the region consisting of some consecutive basic-blocks of the program. A refactoring tool implementing the mechanism constructs a new method that contains the extracted code and re-forms the source method that contains this tool, a programmer indicates only a variable of interest in the code that he/she wants to refactor and then selects a suitable method from among the candidates created by the tool. The programmer does not have to test the refactored code since the mechanism is based on data-and control-flow analysis. Thus the tool enables programmers to avoid manual refactoring whose process is error-prone and time-consuming