refactoring-aware configuration management for object-oriented programs written by: danny dig,...
TRANSCRIPT
Refactoring-aware Configuration Management for Object-Oriented
Programs
Written by: Danny Dig, Kashif Manzoor, Ralph Johnson, and Tien NguyenACM International Conference on Software Engineering, May 2007
Presented by: Bennie Lewis and Volodymyr PryymaSchool of Electrical Engineering and Computer Science
University of Central Florida
Overview
• Introduction• Motivation• Background and Terminology• Merging Algorithm• Implementation• Case Study• Related Work• Conclusions and Future Work
Introduction
• What is refactoring?• Automated refactoring tools– Become very popular– Help change source code quicker
• Demands on SCM systems– Refactoring cuts across module boundaries– Problems with merging refactorings
Introduction
• Refactoring process– Developers check in code– Senior designer makes global changes
• SCM Systems– Unreliable– Method overriding
Introduction
• MolhadoRef– Better merging– Better preservation of program history– Better understanding of program evolution– Operation-based approach– Eclipse as front end– Performs better than CVS
Introduction
• Paper contributions– Refactorings as strongest link in SCM– Algorithm for merging refactorings and edits– Describes the implementation– Evaluates the effectiveness
Motivation
• Text-based SCM systems– No understanding of semantics of changes– No understanding of syntax/semantics of
language– Compile-time errors– Lose the history if refactorings
Background and Terminology
• Operation-based approach– Sequence of operations– Distinguish between operations
• MolhadoRef operations– API refactorings– API edits– Code edits
Background and Terminology
• API refactorings– Rename package/class/method– Move class/method– Change method signature
• API edits– Added package/class/method/field– Deleted package/class/method/field
Background and Terminology
• Code edits– No well defined semantics– Merged textually
• However, API edits/refactorings are merged semantically
Background and Terminology
• Operations– Usually have preconditions• Adding a method• Changing method name
– Inappropriate use
Background and Terminology
• Some definitions– Commute– Conflict– Ordering dependence
Merging Algorithm
• High-level overview– Step 1: detect API and code edits– Step 2: search for conflicts– Step 3: invert each refactoring– Step 4: merge edits textually– Step 5: replay the refactorings
Merging Algorithm
• Detecting Operations– Three-way textual differencer– Construct higher level API edits– Removes edits due to refactorings
Merging Algorithm
• Detecting/Solving of conflicts– Matrix of predicates– Dependencies– User assistance
Merging Algorithm
• Inverting refactoring– Executes inverse refactoring operation– Preconditions• Name collisions
– Worst case scenarios• Treated as text-based merging
Merging Algorithm
• Textual merging– Three-way merging– Same as most text-based SCM systems– Due to inverted refactorings all conflicts are
eliminated– Merging is automatic– MolhadoRef outperforms text-based merging
when multiple refactorigns occur
Implementation
• MolhadoRef acts as Eclipse plugin• It is an object-oriented infrustructure• Java code is translated into Molhado structure• Can be retrofitted on CVS
Case Study• MolhadoRef compared with text-based CVS• MolhadoRef itself for used for analysis• CVS– Many same-line conflicts– Had 48 compile and run-time errors– Took 105 minutes
• MolhadoRef– Much fewer conflicts– Automatically merged all same-line conflicts– Did not introduce any compile or run-time errors– Took less than a minute
Related Work
• SCM Systems– Long history– Provide powerful configuration management
services
• Software Merging– Text-based tool– Lines are as considered indivisible units
Related Work
• Operation-Based Merging– A type of semantic-based merging– Better conflict detection/solving– A few previous operation-based merging systems
were presented
Conclusions and Future Work
• Refactoring creates problems for modern Software Configuration Management systems
• MolhadoRef is aware of refactorings• MolhadoRef is implemented as Eclipse plugin• Future work = empirical study on a group that
uses MolhadoRef
Paper Critique
• Advantages– Novel algorithm– Outperforms CVS– Implemented as Eclipse plugin– Can be added to CVS
• Disadvantages– Only one case study– No performance results with real users
Questions?