Refactorings often require that non-trivial semantic correctness conditions are met. IDEs such as Eclipse’s Java Development Tools rely on simpler, static pre- condition checks for refactorings. This leads to the phenomenon that a seemingly innocuous refactoring can change the behavior of the program. In this thesis we demonstrate our technique of introducing runtime checks of two particular refactorings for the Java programming language: Extract And Move Method, and Extract Local Variable. These checks can, in combination with unit tests, detect changed behavior and identify the refactoring step that introduced it.

This thesis was produced by Anna Maria Eilertsen on the joint master degree PUT between University of Bergen (UiB) and Høyskolen i Bergen (HiB). She was supervised by Volker Stolz from HiB and Anya Bagge from UiB. The thesis was presented at SATToSE in Bergen 2016 and a paper based on this work will be published at ISoLA 2016.