TY - JOUR
T1 - Refactoring and representation independence for class hierarchies
AU - Naumann, David A.
AU - Sampaio, Augusto
AU - Silva, Leila
PY - 2012/5/18
Y1 - 2012/5/18
N2 - Refactoring transformations are important for productivity and quality in software evolution. Modular reasoning about semantics preserving transformations is difficult even in typed class-based languages because transformations can change the internal representations for multiple interdependent classes and because encapsulation can be violated by pointers to mutable objects. In this paper, an existing theory of representation independence for a single class, based on a simple notion of ownership confinement, is generalized to a hierarchy of classes and used to prove refactoring rules that embody transformations of complete class trees. This allows us to formalize refactorings that inherently involve class inheritance, such as Pull Up or Push Down Field; moreover, this makes it possible to generalize refactorings previously restricted to change of data representation of private attributes (like Extract Class and Encapsulate Field) to address data refinement of protected attributes, dealing with the impact that the corresponding transformations may cause in the subclasses. The utility of the proposed rules is shown in a relatively extensive case study. Shortcomings of the theory are described as a challenge to other approaches to heap encapsulation and relational reasoning for classes.
AB - Refactoring transformations are important for productivity and quality in software evolution. Modular reasoning about semantics preserving transformations is difficult even in typed class-based languages because transformations can change the internal representations for multiple interdependent classes and because encapsulation can be violated by pointers to mutable objects. In this paper, an existing theory of representation independence for a single class, based on a simple notion of ownership confinement, is generalized to a hierarchy of classes and used to prove refactoring rules that embody transformations of complete class trees. This allows us to formalize refactorings that inherently involve class inheritance, such as Pull Up or Push Down Field; moreover, this makes it possible to generalize refactorings previously restricted to change of data representation of private attributes (like Extract Class and Encapsulate Field) to address data refinement of protected attributes, dealing with the impact that the corresponding transformations may cause in the subclasses. The utility of the proposed rules is shown in a relatively extensive case study. Shortcomings of the theory are described as a challenge to other approaches to heap encapsulation and relational reasoning for classes.
KW - Class inheritance
KW - Program transformation
KW - Refactoring
KW - Representation independence
KW - Semantics
KW - Verification
UR - http://www.scopus.com/inward/record.url?scp=84859539099&partnerID=8YFLogxK
UR - http://www.scopus.com/inward/citedby.url?scp=84859539099&partnerID=8YFLogxK
U2 - 10.1016/j.tcs.2012.02.009
DO - 10.1016/j.tcs.2012.02.009
M3 - Article
AN - SCOPUS:84859539099
SN - 0304-3975
VL - 433
SP - 60
EP - 97
JO - Theoretical Computer Science
JF - Theoretical Computer Science
ER -