Top Banner
Refactoring-aware Configuration Management for Object-Oriented Programs Written by: Danny Dig, Kashif Manzoor, Ralph Johnson, and Tien Nguyen ACM International Conference on Software Engineering, May 2007 Presented by: Bennie Lewis and Volodymyr Pryyma School of Electrical Engineering and Computer Science University of Central Florida
24

Refactoring-aware Configuration Management for Object-Oriented Programs Written by: Danny Dig, Kashif Manzoor, Ralph Johnson, and Tien Nguyen ACM International.

Dec 18, 2015

Download

Documents

Jordan Brown
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Refactoring-aware Configuration Management for Object-Oriented Programs Written by: Danny Dig, Kashif Manzoor, Ralph Johnson, and Tien Nguyen ACM International.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

Questions?