Code refactoring under constraints

Show simple item record

dc.contributor Raja, Uzma
dc.contributor Carver, Jeffrey C.
dc.contributor Parrish, Allen Scott
dc.contributor.advisor Kraft, Nicholas A.
dc.contributor.advisor Smith, Randy K. Liang, Yan 2017-03-01T14:49:34Z 2017-03-01T14:49:34Z 2011
dc.identifier.other u0015_0000001_0000745
dc.identifier.other Liang_alatus_0004D_10942
dc.description Electronic Thesis or Dissertation
dc.description.abstract Code refactoring is the process of changing the internal structure of the program without changing its external behaviors. Most refactoring tools ensure behavior preservation by enforcing preconditions that must hold for the refactoring to be valid. However, their approaches have three drawbacks that make the refactoring results far from satisfactory and reduce the utilization of refactoring tools in practice. Firstly, programmers are not sure how code will be changed by those tools due to the invisible refactoring rules hidden behind the interfaces of tools. Secondly, current refactoring tools have limited extensibility to accommodate new refactorings. Lastly, most refactoring tools lack mechanisms to allow programmer to specify their own preconditions to indicate as to which properties of a program are of interest. We consider refactoring a code change activity that, as with other constraints imposed on code during software development and maintenance such as naming rules, should be visible, easily extensible, and adaptable. It should also combine the developers' opinions, implementation styles of existing code and other good coding practice. We propose a model-based approach to precondition specification and checking in which preconditions can be declared explicitly and dynamically against the designated program metamodel, and verified against concrete program models. This dissertation applies the approach of model-based refactoring precondition specification and checking on C++ source code refactoring. Based on the analysis of primitive refactorings, we design a C++ language metamodel to support constraint specification and code inspection for refactoring purposes. We then specify preconditions of 18 primitive refactorings against the metamodel, with primary concerns on syntax error prevention and semantic preservation. The impact of a programmer's perspective on these specifications is discussed. As another example to demonstrate the importance and necessities of supporting visible, extensible and adaptable precondition specification and checking, we use template method and singleton patterns to discuss how design patterns can affect refactoring decisions. We set up an experimental environment in which we build the language metamodel, develop a program model extraction tool and simulate the process of precondition specification and verification following the proposed approach.
dc.format.extent 130 p.
dc.format.medium electronic
dc.format.mimetype application/pdf
dc.language English
dc.language.iso en_US
dc.publisher University of Alabama Libraries
dc.relation.ispartof The University of Alabama Electronic Theses and Dissertations
dc.relation.ispartof The University of Alabama Libraries Digital Collections
dc.relation.hasversion born digital
dc.rights All rights reserved by the author unless otherwise indicated.
dc.subject.other Computer science
dc.title Code refactoring under constraints
dc.type thesis
dc.type text University of Alabama. Dept. of Computer Science Computer Science The University of Alabama doctoral Ph.D.

Files in this item

This item appears in the following Collection(s)

Show simple item record

Search DSpace


My Account