RefactoringCrawler is an analysis tool that detects refactorings that happened between two versions of a component. The strenght of the tool lies in the combination of a fast syntactic analysis to detect refactoring candidates, and more expensive semantic analysis to refine these candidates.
Most refactorings involve repartitioning of the source files that results in similar fragments of source text between different versions of a component. Thus, the syntactic analysis identifies those bodies of source text that are similar. The heart of our syntactic analysis is the use of the Shingles encoding to find similar pairs of entities (methods, classes, and packages) in the two versions of the component. Shingles are “fingerprints” for strings with the following property: if a string changes slightly, then its shingles also change slightly. Therefore, shingles enable detection of strings with similar fragments much more robustly than the traditional string matching techniques that are not immune to small perturbations like renamings or small edits.
The semantic analysis is based on reference graphs that represent references among source-level entities, e.g., calls among methods. RefactoringCralwer analyzes the semantic relationship between candidate entities to determine whether they represent a refactoring. Consider for instance a refactoring like RenamedMethod. RefactoringCrawler finds that two methods across the two versions are similar, they are in the same class yet they differ in name. After looking at the methods' call sites, RefactoringCrawler learns that they are called from the same places, therefore it infers that the two methods represent a rename of each other.
We have implemented seven strategies to detect RenameMethod, RenameClass, RenamePackage, MoveMethod, PullUpMethod, PushDownMethod and ChangeMethodSignature refactorings.
Publications: more details can be found in our ECOOP'06 paper:
Danny Dig, Can Comertoglu, Darko Marinov, Ralph Johnson: "Automated Detection of Refactorings in Evolving Components", Proceedings of European Conference on Object-Oriented Programming (ECOOP'06), pp 404-428, Nantes, France.
Visitors since July 1st, 2006