|
|
|
Mark A. Foltz |
|
Design Rationale Group, MIT AI Lab |
|
October 23, 2002 |
|
|
|
|
Problem and Thesis |
|
|
|
What is a Refactoring? |
|
|
|
The Dr. Jones Refactoring Knowledge Base |
|
|
|
A Scenario |
|
|
|
|
Diagrams are natural to plan redesign |
|
But tool-generated diagrams are too complex |
|
So most planning is done with pen-and-paper |
|
|
|
|
Programmers draw task-relevant diagrams on pen
and paper |
|
|
|
Many redesign moves are commonly used
refactorings |
|
|
|
Thesis: If the tool understands refactorings, it
can draw relevant diagrams, and help the programmer explore the program’s
design |
|
|
|
|
|
|
Dr. Jones, a tool for programmers to plan the
refactoring of a Java program |
|
|
|
A knowledge base of refactorings for Java |
|
|
|
Focus tracking: keeping the diagrams simple and
relevant across multiple refactorings |
|
|
|
|
Problem and Thesis |
|
|
|
What is a Refactoring? |
|
|
|
The Dr. Jones Refactoring Knowledge Base |
|
|
|
A Scenario |
|
|
|
|
|
A structural change that improves program
design, while maintaining behavior |
|
|
|
Moving a method to reduce coupling |
|
|
|
Extracting a base class with common methods |
|
|
|
Encapsulating methods in a new delegate |
|
|
|
|
|
|
|
|
|
|
|
How to prove behavior is preserved |
|
How to transform the source |
|
|
|
|
Problem and Thesis |
|
|
|
What is a Refactoring? |
|
|
|
The Dr. Jones Refactoring Knowledge Base |
|
|
|
A Scenario |
|
|
|
|
|
|
|
|
|
Problem and Thesis |
|
|
|
What is a Refactoring? |
|
|
|
The Dr. Jones Refactoring KB |
|
|
|
A Scenario |
|
|
|
|
|
|
|
|
|
|
|
|
Problem and Thesis |
|
|
|
What is a Refactoring? |
|
|
|
The Dr. Jones Refactoring KB |
|
|
|
A Scenario |
|
|
|
|
50 Refactorings Specified |
|
|
|
Analysis and Diagramming Infrastructure |
|
|
|
Scenario Refactorings Implemented |
|
|
|
Focus Set Tracking |
|
|
|
Remaining Refactorings |
|
|
|
Evaluation |
|
|