modularization compass - navigating white waters of feature-oriented modularity
DESCRIPTION
ICSOFT-EA slidesTRANSCRIPT
Modularization Compass:Navigating the White Waters
of Feature-Oriented Modularity
Andrzej Olszak and Bo Nørregaard JørgensenThe Maersk Mc-Kinney Moller Institute
University of Southern Denmark
Agenda
1. Motivation2. Features3. Evolution of feature modularity4. Drift of modularity5. Evaluation6. Results
Motivation
• Software systems have to evolve to accommodate new user expectations:– Add and enhance features– Fix existing features
• Working with existing code is difficult:– Where is this feature implemented?– Why is this logic here?– Can this change break another feature?
• It only gets more difficult over time!
Features – user’s perspective on code
• Feature – unit of user-identifiable functionality of software– Scattering increases change scope and delocalization effects– Tangling increases change propagation and interleaving effects
Tracking the evolution of features
Add feature Enhance feature
FSCA=2 (2+2)/2
(3+2)/2
• Are these values low or high?– Should we aim for FSCA=1? What is the ‘optimal’ value?
• How much can be improved by refactoring?– When to refactor?– What/how to refactor?
?!
Drift of modularity as distance to ‘optimum’
• Drift is the distance between the actual and the ‘optimal’ values of a metric– ‘optimal’ = after applying optimal refactorings*
r1 r2 r3 r4
Actual modularizationOptimal modularization
Absolutevalue
Drift– Distance from optimal design– Potential for refactoring
Calculating drift
• Obtaining ‘optimal’ modularizations– Criteria for detecting ‘optimality’– Efficient traversal of design space– Automated refactorings
Modularization goals
• Feature + object-oriented criteria
Calculating drift by optimizing program structure
• Multi-objective optimization of package structures to modularize features– Based on the move-class refactoring
• MOGGA: genetic algorithm on a population of designs– Pareto-optimality– Grouping operators
• Resulting designs established using automated code transformations
Example optimization results
• MOGGA config: population of 300 designs over 500 iterations with 5% mutation prob.
0
0.005
0.01
0.015
0.02
0.025
0.03
JHotDraw SVGScattering -55%
OriginalAutomated
Feature
fsca
0
0.002
0.004
0.006
0.008
0.01
0.012
0.014
0.016
0.018
0.02
JHotDraw SVGTangling -60%
Original
Packageft
ang
Evaluation
• Goal: To evaluate whether drift-based metrics bring new information, as compared to their absolute counterparts
• Procedure:1. Locate features in code2. Measure of absolute Scattering and Tangling3. Measure drifts
• Target: release histories of 3 OSS
Feature location
• Recovered feature specifications from documentation and UIs
• Located features in classes and methods using execution tracing and feature-entry annotations
Application releases Identified features
JHotDraw Pert11 Releases: 5.2; 5.3; 5.4b1; 6.0b1; 7.0.7; 7.0.8; 7.0.9; 7.1; 7.2; 7.3; 7.3.1
Align, Dependency tool, Edit basic, Edit figure, Exit program, Export drawing (7.0.7), Group figures, Init program, Line tool (removed in 6.0b1), Modify figure, Multiple windows (7.0.7), New drawing, Open drawing, Order figures, Save as drawing, Selection tool, Snap to grid, Task tool, Text tool, Undo redo (5.3), Zoom (7.0.7)
RText17 Releases
…
FreeMind13 Releases
…
Results – JHotDraw Pert
• Abs: FSCA FTANG • Drift: FSCA FTANG
– FTANG drift > FSCA drift
• Architectural refactoring in v7.0.7– Improved separation of features– FSCA: drift decreases while absolute
value increases
• Abs: FSCA FTANG• Drift: FSCA FTANG
– FSCA drift remains constant while absolute value increases
5.2
5.3
5.4b
1
6.0b
1
7.0.
7
7.0.
8
7.0.
9
7.1
7.2
7.3
7.3.
1
0
1
2
3
4
5
6
7
8
9 Scattering drift of Pert
Release
FSCA
5.2
5.3
5.4b
1
6.0b
1
7.0.
7
7.0.
8
7.0.
9
7.1
7.2
7.3
7.3.
1
0
2
4
6
8
10
12
14 Tangling drift of Pert
Drift of tangling Absolute tangling
Release
FTAN
G
Some trends in remaining results“Breakaway” points
“Oscillations” of drift?(Antón and Potts, 2003)
Tangling drift > scattering drift
(potential for separating)
0.0.
20.
0.3
0.1.
00.
2.0
0.3.
00.
3.1
0.4.
00.
5.0
0.6.
00.
6.1
0.6.
50.
6.7
0.7.
1
02468
101214161820 Tangling drift of FreeMind
Drift of tangling Absolute tangling
Release
FTAN
G
0.8.
00.
8.1
0.8.
20.
8.3
0.8.
40.
8.5
0.8.
60.
8.7
0.8.
80.
8.9
0.9.
00.
9.2
0.9.
30.
9.4
0.9.
50.
9.7
0.9.
8
0
2
4
6
8
10
12 Tangling drift of RText
Drift of tangling Absolute tangling
Release
FTAN
G
0.8.
00.
8.1
0.8.
20.
8.3
0.8.
40.
8.5
0.8.
60.
8.7
0.8.
80.
8.9
0.9.
00.
9.2
0.9.
30.
9.4
0.9.
50.
9.7
0.9.
80123456789
10 Scattering drift of RText
Drift of scattering Absolute scattering
Release
FSCA
0.0.
20.
0.3
0.1.
00.
2.0
0.3.
00.
3.1
0.4.
00.
5.0
0.6.
00.
6.1
0.6.
50.
6.7
0.7.
1
0
1
2
3
4
5
6
7 Scattering drift of FreeMind
Drift of scattering Absolute scattering
Release
FSCA
Conclusion & Next steps
• Drift:– Distance from ‘optimum’– Potential for refactoring– Not limited to feature-oriented metrics!
• Interesting observations from the 3 systems– Demonstrated usefulness, more data needed to
fully understand and generalize the observations• MOGGA config & performance can be optimized• Method-level refactorings can be explored
Questions?