Modularization of Legacy Features by Relocation and Reconceptualization:
How Much is Enough?
— ―
Andrzej Olszak and Bo Nørregaard Jørgensen
Agenda
I. Prologue: The Case of NDVisII. Relocation & ReconceptualizationIII. Experimental DesignIV. Results
— 2 —
— 3 —
Prologue
“Can you help us to migrate NDVis to the NetBeans Module System?”
— 4 —
Dividing the monolith
Module System ≠ modularity Features are great candidates for
Modules!Feature is the unit of program functionality
…but getting there is difficult
— 4 —
Dividing the monolith
Module System ≠ modularity Features are great candidates for
Modules!Feature is the unit of program functionality
…but getting there is difficult
Cont ro l l e r
Mode l
View
feature A feature B feature C
— 4 —
Dividing the monolith
Module System ≠ modularity Features are great candidates for
Modules!Feature is the unit of program functionality
…but getting there is difficult
Cont ro l l e r
Mode l
View
feature A feature B feature C
— 4 —
Dividing the monolith
Module System ≠ modularity Features are great candidates for
Modules!Feature is the unit of program functionality
…but getting there is difficult
Cont ro l l e r
Mode l
View
feature A feature B feature C
Scattering
— 4 —
Dividing the monolith
Module System ≠ modularity Features are great candidates for
Modules!Feature is the unit of program functionality
…but getting there is difficult
Cont ro l l e r
Mode l
View
feature A feature B feature C
Scattering
Tangling
— 4 —
Dividing the monolith
Module System ≠ modularity Features are great candidates for
Modules!Feature is the unit of program functionality
…but getting there is difficult
Cont ro l l e r
Mode l
View
feature A feature B feature C
Scattering
Tangling
— 5 —
The case of NDVis
Mixin layers, aspects, etc. “Let’s stick to Java”
Independent feature-modules Reusable core modules
+ →
NDVis monolith
Featureous tool
— 6 —
“Can we learn more about these restructurings?”
— 7 —
Treatment of classes! Relocation
i.e. move-class refactoring Simple Automatable Classes remain tangled
pkg2
pkg1
feature A feature B feature C
— 7 —
Treatment of classes! Relocation
i.e. move-class refactoring Simple Automatable Classes remain tangled
pkg2
pkg1
feature A feature B feature C
→feature A feature Bfeature C
— 7 —
Treatment of classes! Relocation
i.e. move-class refactoring Simple Automatable Classes remain tangled
pkg2
pkg1
feature A feature B feature C
→→
feature A feature Bfeature C
— 7 —
Treatment of classes! Relocation
i.e. move-class refactoring Simple Automatable Classes remain tangled
Reconceptualizationi.e. move-method refactoring Complex Inherently manual Untangles classes
pkg2
pkg1
feature A feature B feature C
→→
feature A feature Bfeature C
feature B
feature A
Student
feature C
— 7 —
Treatment of classes! Relocation
i.e. move-class refactoring Simple Automatable Classes remain tangled
Reconceptualizationi.e. move-method refactoring Complex Inherently manual Untangles classes
pkg2
pkg1
feature A feature B feature C
→→
feature A feature Bfeature C
feature B
feature A
Student
feature C
→Studentread()eat()sleep()
feature B
feature C
feature A
— 8 —
Experimental construct
Tang
ling
in p
kgs
Scattering in pkgs
Original design
— 8 —
Experimental construct
Tang
ling
in p
kgs
Scattering in pkgs
Original design
Manual relocation + reconceptualization
— 8 —
Experimental construct
― Q1 ―Manual modularization vs. Max relocation?
Tang
ling
in p
kgs
Scattering in pkgs
Max relocation
Original design
Manual relocation + reconceptualization
— 8 —
Experimental construct
― Q1 ―Manual modularization vs. Max relocation?
― Q2 ―Isolated impact of manual reconceptualization?
Tang
ling
in p
kgs
Scattering in pkgs
Max relocation
Original design
Manual relocation + reconceptualization
Max relocation + manual reconceptualization
— 8 —
Experimental construct
― Q1 ―Manual modularization vs. Max relocation?
― Q2 ―Isolated impact of manual reconceptualization?
― Q3 ―Relative impact of manual reconceptualization?
Tang
ling
in p
kgs
Scattering in pkgs
Max relocation
Max reconceptualization
Original design
Manual relocation + reconceptualization
Max relocation + manual reconceptualization
— 9 —
Q1: Automatic Relocation design
Maximum relocation No reconceptualization
Multi-objective relocation of classes in original program—Scattering—Tangling—Cohesion—Coupling
Automatic relocation significantly more efficient Time-intensity: 35 hours vs. 5 minutes
0.05 0.1 0.15 0.2 0.25 0.3
0
0.05
0.1
0.15
0.2
0.25
Scattering
Tan
glin
g
Original
Manual
Automatic
— 10 —
Q2: Manual+Automatic design
Maximum relocation Manual reconceptualization
Multi-objective relocation of classes in manual design
Contribution of manual reconceptualization is minor
Manual approach better at selected features
0.05 0.1 0.15 0.2 0.25 0.3
0
0.05
0.1
0.15
0.2
0.25
Scattering
Tan
glin
g
Original
Manual
Manual+Automatic
Automatic
— 11 —
Q3: Automatic Split design Maximum relocation Maximum reconceptualization
Simulated clean splits in manual design
Multi-objective relocation of classes in resulting design
Manual restructuring achieved a high degree of reconceptualization
Maximum effects of reconceptualization << relocation
0.05 0.1 0.15 0.2 0.25 0.3
0
0.05
0.1
0.15
0.2
0.25
Scattering
Tan
glin
g
Original
Manual
Manual+Automatic
Automatic
split
AutomaticStuden
tread()eat()sleep()feature
B
feature C
feature A
— 12 —
Conclusions
Reconceptualization with mixin layers or aspects would not give us a lot…
Focus on relocation – reconceptualize sparingly Dynamic dependencies among features Module system constraints
Better yet: Relocate automatically before you
reconceptualize!
― END ―
Controller
Model
View
feature Afeature B
feature C
Treatment of classes
→→
feature Afeature B
feature C
→
Studentread()eat()sleep()
feature B
feature C
feature Bfeature C
Student
feature C
feature B
eat(){ if (values.length==0){ read(); return; }
this.numbers = values; number = values.length; quicksort(0, number - 1);
}
←… ←
→
Top Related