Safer Refactorings
Refactorings are a common tool of the trade for programming. In general, they are assumed to be equivalent transformations of a program, to improve the quality of the source code with regard to a concrete or subjective software metric, such as coupling. Alas, some seemingly intuitive refactorings do NOT preserve the original semantics. Especially for OO programs, proving a particular refactoring as correct is a complex, if not even infeasible task, e.g. in the presence of virtual method calls. We look at particular refactorings, and suggest to encode the assumptions necessary for their correctness in the form of assertions.
While this does not directly preclude the developer from applying "wrong" refactorings, it makes the necessary assumptions explicit.
A prospective student would familiarise himself with refactoring as they are implemented in common IDEs (Eclipse, IntelliJ, NetBeans, MS Visual Studio) and from literature (Design Pattern-book, see below). In a survey, each refactoring/pattern is classified whether it produces an equivalent program with regard to effects commonly found in OO programs, such as so-called aliasing (above), or virtual method calls.
Requirements:
- interest and experience in object-oriented programming languages
Bibliography:
-
Design Patterns: Elements of Reusable Object-Oriented Software
, Gamma, Helm, Johnson, Vlissides -
Refactoring. Improving the Design of Existing Code
, Fowler - Challenge proposal: verification of refactorings, Schäfer, Ekman, de Moor, PLPV'09