Refactoring for generalization using type constraints

Frank Tip, Adam Kieżun, Dirk Bäumer

2003 · 125 citations · 10 references

Concepts

TL;DR

Refactoring improves program design by applying behavior‑preserving transformations, with preconditions and source‑code modifications that depend on interprocedural type relationships, especially for generalization refactorings such as Extract Interface and Pull Up Members. The study proposes using type constraints to verify preconditions and determine allowable modifications for generalization refactorings. The approach applies type constraints to check preconditions and guide source‑code changes in Eclipse. This work is implemented in the standard distribution of Eclipse (see www.eclipse.org).

Abstract

Refactoring is the process of applying behavior-preserving transformations (called "refactorings") in order to improve a program's design. Associated with a refactoring is a set of preconditions that must be satisfied to guarantee that program behavior is preserved, and a set of source code modifications. An important category of refactorings is concerned with generalization (e.g., Extract Interface for re-routing the access to a class via a newly created interface, and Pull Up Members for moving members into a superclass). For these refactorings, both the preconditions and the set of allowable source code modifications depend on interprocedural relationships between types of variables. We present an approach in which type constraints are used to verify the preconditions and to determine the allowable source code modifications for a number of generalization-related refactorings. This work is implemented in the standard distribution of Eclipse (see www.eclipse.org).

References

10