An Approach to Invariant-based Program Refactoring - Massoni, Tiago (Electronic Communications of the EASST, 2007)
Refactoring tools include checking of an object-oriented program for thefulfillment of preconditions, for ensuring correctness. However, program invariantsâ semantic information about classes and fields assumed valid during program executionâ are not considered by this precondition checking. As a result, applicabilityof automated refactorings is constrained in these cases, as refactorings that would beapplicable considering the invariants get rejected, usually requiring manual changes.In this paper, we describe initial work on the use of program invariants (declared ascode annotations) to increase applicability of automated refactoring. We propose anapproach that uses primitive program transformations that employ the invariant tomake the program syntactically amenable to the desired refactoring, before applyingthe refactoring itself.