Refactoring for Generalization using Type Constraints

Copyright © (2003) by Association for Computing Machinery, Inc. Permission to make digital or hard copies of part or all of this work for personal or classroom use is granted without fee provided that copies are not made or distrubuted for profit or commericial advantage. To copy otherwise, to republish, to post on servers, or to redistribute to lists, requires prior specific permission and/or a fee.

Refactoring is the process of applying behavior-preserving transformations (called "refactorings")in order to improve a program it'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 accessto aclassvia anewlycreated interface,and Pull Up Members for moving members into a (upperclass).For these refactorings,both the preconditions and the set of allowable source code modifications depends 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 (available from

By: Frank Tip, Adam Kiezun, Dirk Baeumer

Published in: ACM SIGPLAN Notices, volume 38, (no 11), pages 13-26 in 2003


This Research Report is available. This report has been submitted for publication outside of IBM and will probably be copyrighted if accepted for publication. It has been issued as a Research Report for early dissemination of its contents. In view of the transfer of copyright to the outside publisher, its distribution outside of IBM prior to publication should be limited to peer communications and specific requests. After outside publication, requests should be filled only by reprints or legally obtained copies of the article (e.g., payment of royalties). I have read and understand this notice and am a member of the scientific community outside or inside of IBM seeking a single copy only.


Questions about this service can be mailed to .