![Page 1: Refactoring-aware Configuration Management for Object-Oriented Programs Written by: Danny Dig, Kashif Manzoor, Ralph Johnson, and Tien Nguyen ACM International](https://reader030.vdocuments.net/reader030/viewer/2022032703/56649d0b5503460f949de8c5/html5/thumbnails/1.jpg)
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
![Page 2: Refactoring-aware Configuration Management for Object-Oriented Programs Written by: Danny Dig, Kashif Manzoor, Ralph Johnson, and Tien Nguyen ACM International](https://reader030.vdocuments.net/reader030/viewer/2022032703/56649d0b5503460f949de8c5/html5/thumbnails/2.jpg)
Overview
• Introduction• Motivation• Background and Terminology• Merging Algorithm• Implementation• Case Study• Related Work• Conclusions and Future Work
![Page 3: Refactoring-aware Configuration Management for Object-Oriented Programs Written by: Danny Dig, Kashif Manzoor, Ralph Johnson, and Tien Nguyen ACM International](https://reader030.vdocuments.net/reader030/viewer/2022032703/56649d0b5503460f949de8c5/html5/thumbnails/3.jpg)
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
![Page 4: Refactoring-aware Configuration Management for Object-Oriented Programs Written by: Danny Dig, Kashif Manzoor, Ralph Johnson, and Tien Nguyen ACM International](https://reader030.vdocuments.net/reader030/viewer/2022032703/56649d0b5503460f949de8c5/html5/thumbnails/4.jpg)
Introduction
• Refactoring process– Developers check in code– Senior designer makes global changes
• SCM Systems– Unreliable– Method overriding
![Page 5: Refactoring-aware Configuration Management for Object-Oriented Programs Written by: Danny Dig, Kashif Manzoor, Ralph Johnson, and Tien Nguyen ACM International](https://reader030.vdocuments.net/reader030/viewer/2022032703/56649d0b5503460f949de8c5/html5/thumbnails/5.jpg)
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
![Page 6: Refactoring-aware Configuration Management for Object-Oriented Programs Written by: Danny Dig, Kashif Manzoor, Ralph Johnson, and Tien Nguyen ACM International](https://reader030.vdocuments.net/reader030/viewer/2022032703/56649d0b5503460f949de8c5/html5/thumbnails/6.jpg)
Introduction
• Paper contributions– Refactorings as strongest link in SCM– Algorithm for merging refactorings and edits– Describes the implementation– Evaluates the effectiveness
![Page 7: Refactoring-aware Configuration Management for Object-Oriented Programs Written by: Danny Dig, Kashif Manzoor, Ralph Johnson, and Tien Nguyen ACM International](https://reader030.vdocuments.net/reader030/viewer/2022032703/56649d0b5503460f949de8c5/html5/thumbnails/7.jpg)
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
![Page 8: Refactoring-aware Configuration Management for Object-Oriented Programs Written by: Danny Dig, Kashif Manzoor, Ralph Johnson, and Tien Nguyen ACM International](https://reader030.vdocuments.net/reader030/viewer/2022032703/56649d0b5503460f949de8c5/html5/thumbnails/8.jpg)
Background and Terminology
• Operation-based approach– Sequence of operations– Distinguish between operations
• MolhadoRef operations– API refactorings– API edits– Code edits
![Page 9: Refactoring-aware Configuration Management for Object-Oriented Programs Written by: Danny Dig, Kashif Manzoor, Ralph Johnson, and Tien Nguyen ACM International](https://reader030.vdocuments.net/reader030/viewer/2022032703/56649d0b5503460f949de8c5/html5/thumbnails/9.jpg)
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
![Page 10: Refactoring-aware Configuration Management for Object-Oriented Programs Written by: Danny Dig, Kashif Manzoor, Ralph Johnson, and Tien Nguyen ACM International](https://reader030.vdocuments.net/reader030/viewer/2022032703/56649d0b5503460f949de8c5/html5/thumbnails/10.jpg)
Background and Terminology
• Code edits– No well defined semantics– Merged textually
• However, API edits/refactorings are merged semantically
![Page 11: Refactoring-aware Configuration Management for Object-Oriented Programs Written by: Danny Dig, Kashif Manzoor, Ralph Johnson, and Tien Nguyen ACM International](https://reader030.vdocuments.net/reader030/viewer/2022032703/56649d0b5503460f949de8c5/html5/thumbnails/11.jpg)
Background and Terminology
• Operations– Usually have preconditions• Adding a method• Changing method name
– Inappropriate use
![Page 12: Refactoring-aware Configuration Management for Object-Oriented Programs Written by: Danny Dig, Kashif Manzoor, Ralph Johnson, and Tien Nguyen ACM International](https://reader030.vdocuments.net/reader030/viewer/2022032703/56649d0b5503460f949de8c5/html5/thumbnails/12.jpg)
Background and Terminology
• Some definitions– Commute– Conflict– Ordering dependence
![Page 13: Refactoring-aware Configuration Management for Object-Oriented Programs Written by: Danny Dig, Kashif Manzoor, Ralph Johnson, and Tien Nguyen ACM International](https://reader030.vdocuments.net/reader030/viewer/2022032703/56649d0b5503460f949de8c5/html5/thumbnails/13.jpg)
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
![Page 14: Refactoring-aware Configuration Management for Object-Oriented Programs Written by: Danny Dig, Kashif Manzoor, Ralph Johnson, and Tien Nguyen ACM International](https://reader030.vdocuments.net/reader030/viewer/2022032703/56649d0b5503460f949de8c5/html5/thumbnails/14.jpg)
Merging Algorithm
• Detecting Operations– Three-way textual differencer– Construct higher level API edits– Removes edits due to refactorings
![Page 15: Refactoring-aware Configuration Management for Object-Oriented Programs Written by: Danny Dig, Kashif Manzoor, Ralph Johnson, and Tien Nguyen ACM International](https://reader030.vdocuments.net/reader030/viewer/2022032703/56649d0b5503460f949de8c5/html5/thumbnails/15.jpg)
Merging Algorithm
• Detecting/Solving of conflicts– Matrix of predicates– Dependencies– User assistance
![Page 16: Refactoring-aware Configuration Management for Object-Oriented Programs Written by: Danny Dig, Kashif Manzoor, Ralph Johnson, and Tien Nguyen ACM International](https://reader030.vdocuments.net/reader030/viewer/2022032703/56649d0b5503460f949de8c5/html5/thumbnails/16.jpg)
Merging Algorithm
• Inverting refactoring– Executes inverse refactoring operation– Preconditions• Name collisions
– Worst case scenarios• Treated as text-based merging
![Page 17: Refactoring-aware Configuration Management for Object-Oriented Programs Written by: Danny Dig, Kashif Manzoor, Ralph Johnson, and Tien Nguyen ACM International](https://reader030.vdocuments.net/reader030/viewer/2022032703/56649d0b5503460f949de8c5/html5/thumbnails/17.jpg)
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
![Page 18: Refactoring-aware Configuration Management for Object-Oriented Programs Written by: Danny Dig, Kashif Manzoor, Ralph Johnson, and Tien Nguyen ACM International](https://reader030.vdocuments.net/reader030/viewer/2022032703/56649d0b5503460f949de8c5/html5/thumbnails/18.jpg)
Implementation
• MolhadoRef acts as Eclipse plugin• It is an object-oriented infrustructure• Java code is translated into Molhado structure• Can be retrofitted on CVS
![Page 19: Refactoring-aware Configuration Management for Object-Oriented Programs Written by: Danny Dig, Kashif Manzoor, Ralph Johnson, and Tien Nguyen ACM International](https://reader030.vdocuments.net/reader030/viewer/2022032703/56649d0b5503460f949de8c5/html5/thumbnails/19.jpg)
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
![Page 20: Refactoring-aware Configuration Management for Object-Oriented Programs Written by: Danny Dig, Kashif Manzoor, Ralph Johnson, and Tien Nguyen ACM International](https://reader030.vdocuments.net/reader030/viewer/2022032703/56649d0b5503460f949de8c5/html5/thumbnails/20.jpg)
Related Work
• SCM Systems– Long history– Provide powerful configuration management
services
• Software Merging– Text-based tool– Lines are as considered indivisible units
![Page 21: Refactoring-aware Configuration Management for Object-Oriented Programs Written by: Danny Dig, Kashif Manzoor, Ralph Johnson, and Tien Nguyen ACM International](https://reader030.vdocuments.net/reader030/viewer/2022032703/56649d0b5503460f949de8c5/html5/thumbnails/21.jpg)
Related Work
• Operation-Based Merging– A type of semantic-based merging– Better conflict detection/solving– A few previous operation-based merging systems
were presented
![Page 22: Refactoring-aware Configuration Management for Object-Oriented Programs Written by: Danny Dig, Kashif Manzoor, Ralph Johnson, and Tien Nguyen ACM International](https://reader030.vdocuments.net/reader030/viewer/2022032703/56649d0b5503460f949de8c5/html5/thumbnails/22.jpg)
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
![Page 23: Refactoring-aware Configuration Management for Object-Oriented Programs Written by: Danny Dig, Kashif Manzoor, Ralph Johnson, and Tien Nguyen ACM International](https://reader030.vdocuments.net/reader030/viewer/2022032703/56649d0b5503460f949de8c5/html5/thumbnails/23.jpg)
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
![Page 24: Refactoring-aware Configuration Management for Object-Oriented Programs Written by: Danny Dig, Kashif Manzoor, Ralph Johnson, and Tien Nguyen ACM International](https://reader030.vdocuments.net/reader030/viewer/2022032703/56649d0b5503460f949de8c5/html5/thumbnails/24.jpg)
Questions?