Automated Support for Program Refactoring using Invariants

  • Authors:
  • Yoshio Kataoka;David Notkin;Michael D. Ernst;William G. Griswold

  • Affiliations:
  • University of Washington;University of Washington;MIT Lab for Computer Science;University of California San Diego

  • Venue:
  • ICSM '01 Proceedings of the IEEE International Conference on Software Maintenance (ICSM'01)
  • Year:
  • 2001

Quantified Score

Hi-index 0.00

Visualization

Abstract

Program refactoring - transforming a program to improve readability, structure, performance, abstraction, maintainability, or other features - is not applied in practice as much as might be desired. One deterrent is the cost of detecting candidates for refactoring and of choosing the appropriate refactoring transformation. This paper demonstrates the feasibility of automatically finding places in the program that are candidates for specific refactorings. The approach uses program invariants: when a particular pattern of invariant relationships appears at a program point, a specific refactoring is applicable. Since most programs lack explicit invariants, an invariant detection tool called Daikon is used to infer the required invariants. We developed an invariant pattern matcher for several common refactorings and applied it to an existing Java code base. Numerous refactorings were detected, and one of the developers of th code base assesed their efficacy.