Upload
andrzej-olszak
View
213
Download
1
Embed Size (px)
DESCRIPTION
Defense slides
Citation preview
Ph.D. Defense:
Featureous: An Integrated ApproachTo Location, Analysis And Modularization
Of Features In Java Applications
Andrzej Olszak
Road to this defense
0
10
20
30
40
50
60
70
80
90
2007 2008 2009 2010 2011 2012
latitu
de
year
Publications
Main Publications
• [TOOLS’12] Olszak, A., Bouwers, E., Jørgensen, B. N. and Visser J. (2012). Detection of Seed Methods for Quantification of Feature Confinement. In TOOLS’12: Proceeding of the TOOLS Europe: Objects, Models, Components, Patterns, Springer LNCS, Vol. 7304, pp 252-268.
• [CSMR’12] Olszak, A. and Jørgensen, B. N. (2012). Modularization of Legacy Features by Relocation and Reconceptualization: How Much is Enough? In CSMR’12: Proceedings of the 16th European Conference on Software Maintenance and Reengineering, IEEE Computer Society Press, pp. 171-180.
• [SCICO’12] Olszak, A. and Jørgensen, B. N. (2012). Remodularizing Java Programs for Improved Locality of Feature Implementations in Source Code. Science of Computer Programming, Elsevier, Vol. 77, no. 3, pp. 131-151.
• [CSIS’11] Olszak, A. and Jørgensen, B.N. (2011). Featureous: An Integrated Environment for Feature-centric Analysis and Modification of Object-oriented Software. International Journal on Computer Science and Information Systems, Vol. 6, No. 1, pp. 58-75.
• [SEA’10] Olszak, A. and Jørgensen, B. N. (2010). A unified approach to feature-centric analysis of object-oriented software. In SEA’10: Proceedings of the IASTED International Conference Software Engineering and Applications, ACTA Press, pp. 494-503.
• [AC’10] Olszak, A. and Jørgensen, B. N. (2010). Featureous: Infrastructure for feature-centric analysis of object-oriented software. In AC’10: Proceedings of IADIS International Conference Applied Computing, pp. 19-26.
• [FOSD’09] Olszak, A. and Jørgensen, B. N. (2009). Remodularizing Java programs for comprehension of features. In FOSD’09: Proceedings of the First International Workshop on Feature-Oriented Software Development, ACM, pp. 19-26.
Short Papers and Tool Demo Papers
• [WCRE’11a] Olszak, A., Jensen, M. L. R. and Jørgensen, B. N. (2011). Meta-Level Runtime Feature Awareness for Java. In WCRE’11: Proceedings of the 18th Working Conference on Reverse Engineering, IEEE Computer Society Press, pp. 271-274.
• [WCRE’11b] Olszak, A. and Jørgensen, B. N. (2011). Understanding Legacy Features with Featureous. In WCRE’11: Proceedings of the 18th Working Conference on Reverse Engineering, IEEE Computer Society Press, pp. 435-436.
• [ICPC’10] Olszak, A. and Jørgensen, B. N. (2010). Featureous: A Tool for Feature-Centric Analysis of Java Software. In ICPC’10: Proceedings of IEEE 18th International Conference on Program Comprehension, IEEE Computer Society Press, pp. 44-45.
Agenda
1. Motivation
2. Overview of Featureous
3. Feature Location
4. Feature-Oriented Analysis
5. Demo
6. Feature-Oriented Remodularization
7. Automating Measurement of Features
8. Conclusions
Motivation
The Role of Modularity
•‘Proper’ modularization facilitates:• Comprehension: understanding systems one module at a time• Change: modifying modules independently•Work division: dividing work on modules boundaries
•There are various criteria for dividing software into modules
The Role of Modularity
•‘Proper’ modularization facilitates:• Comprehension: understanding systems one module at a time• Change: modifying modules independently•Work division: dividing work on modules boundaries
•There are various criteria for dividing software into modules
The Role of Modularity
•‘Proper’ modularization facilitates:• Comprehension: understanding systems one module at a time• Change: modifying modules independently•Work division: dividing work on modules boundaries
•There are various criteria for dividing software into modules
The Role of Features
Evolution &maintenance
60-90%
Initial development10-40%
The Role of Features
Evolution &maintenance
60-90%
Initial development10-40%
Functionality-oriented evolutionary changes
75%
Other evolutionary changes25%
The Role of Features
• Feature – unit of user-identifiable functionality of software
• Feature-oriented change in nutshell:
– User RequestDeveloperCode
Evolution &maintenance
60-90%
Initial development10-40%
Functionality-oriented evolutionary changes
75%
Other evolutionary changes25%
Features in OO software
• Features as inter-class collaborations:– Implicit mappings and boundaries– Scattered (increased change scope and delocalization effects)– Tangled (increased change propagation and interleaving effects)
RQ: How can features of Java applications be located, analyzed and modularized to support comprehension and modification during software evolution?
Overview of Featureous
Conceptual model of Featureous
• Layered conceptual model
– Incremental design, implementation and evaluation
The Featureous Workbench
• Tool-based approach – implemented as NetBeans plugin
• Applicative studies as evaluation
Featureous Location
The Challenge of Feature Location
• Feature location – identifying source code units that implement features
• Manual approaches
– Problems with scaling and reproducibility
• Existing semi-automated approaches
– Require dedicated test suites
– Rely on artifacts other than source code
The Method
• Dynamic analysis – execution tracing
– Resolutions of polymorphism and conditionals
• The notion of feature-entry points
– Annotated “entrances to features” to guide tracing
Feature Tracer with AspectJ LTW
Feature Tracer with AspectJ LTW
@
Feature Tracer with AspectJ LTW
@
Reflect
Feature Tracer with AspectJ LTW
@
Reflect @
Evaluation
BlueJ JHotDraw SVG
Application size 78 KLOC 62 KLOC
Number of identified use cases 127 90
Number of identified features 41 31
Number of feature-entry points 228 91
Class code coverage 66% 75%
Total time 8 hours 5 hours
Estimated manual location time* 111-195 hours 89-155 hours
• Applied to 6 medium-sized unfamiliar OSS
– Discussed cases of BlueJ and JHotDraw SVG
Featureous Analysis
Features as Units of Code Analysis
• Feature-oriented analysis treats features as first-class code investigation entities
• Several metrics and visualizations exist– Not always compatible with one another
– Need firm evolutionary grounding
– Lack of usable implementations
Structuring Feature-Oriented Analysis
• Unifying conceptual framework for describing views
– Granularity, Perspective, Abstraction
g1
package
Abstraction
Granularity
g2
classg3
method
p1
feature
p2
code
unit
p3
feature
relation
s
a1 traceability
a2 correlation
a3 characterization
Persp
ective
• Objective definition of views
• 3x3x3 possible configurations
Instantiating the Framework
Request for change
Planning phaseChange
implementationVerificationand validation
Software comprehension
Change impact analysis
Restructuring for change
Change propagation
Granularity n/a g2
g1
g2
g1
g3
g2
g1
g3
g2
g3
g2
…
Instantiating the Framework
Request for change
Planning phaseChange
implementationVerificationand validation
Software comprehension
Change impact analysis
Restructuring for change
Change propagation
Granularity n/a g2
g1
g2
g1
g3
g2
g1
g3
g2
g3
g2
…
Feature-aware source code editor
Feature-code correlation graphFeature-code correlation grid
Feature-code 3D characterization
Feature relations characterization
Feature inspector
Feature call-tree
Instantiating the Framework
Request for change
Planning phaseChange
implementationVerificationand validation
Software comprehension
Change impact analysis
Restructuring for change
Change propagation
Granularity n/a g2
g1
g2
g1
g3
g2
g1
g3
g2
g3
g2
…
Feature-aware source code editor
Feature-code correlation graphFeature-code correlation grid
Feature-code 3D characterization
Feature relations characterization
Feature inspector
Feature call-tree
…
Evaluation
1. Parnas’ KWIC textbook example– 4 modularization alternatives– Results consistent with
analyses of Parnas and Garlan
2. Feature-Oriented comprehension of JHotDraw SVG
3. Adoption of feature-oriented change in JHotDraw SVG4. Analytical evaluation of support for comprehension with the
framework of Storey et al.
Shareddata
Abstractdata type
Implicit invocation
Pipesand filters
Scattering 0.29 0.35 0.20 0.20
Tangling 0.18 0.30 0.15 0.15
Change in function [23] + - + +
Demo of Featureous Workbench
Featureous Remodularization
Modularizing Features in Existing Systems
• Feature-oriented analysis alone does not reduce the scope of changes
• Physical modularization of features needed for:
– Reducing comprehension scope
– Reducing change propagation
– Facilitate per-feature division of work
Restructuring to Features
• Two fundamental class-level refactoring types
– Class relocation• Simple
• Does not untangle classes
– Class reconceptualization• Can be complex
• Untangles classes
• Fragility of class-level decomposition
– Domain entities as aggregates of feature-roles
– Problematic semantics of entity-fragments
Feature-Oriented Structure of Applications
“UI”
“Logic”
“Domain Model”
Evaluation: the Case of NDVis
• Neurological analysis tool by VisiTrend:
– Monolithic -> NetBeans MS, to improve customizability and reuse of core algorithms
– 10 KLOC, 27 use cases, 10 features
– No unit tests, unfamiliar source code, complex domain
• Application of Featureous:
– Initial analysis + Iterative modularization
Modularization in 35 Hours
• Explicit and pluggable features
• Reusable core
• Biggest challenge: decentralizing initialization of features
3rd-Party Metrics:
Scattering 16%
Tangling 27%
Cohesion 31%
Coupling 5%
Automated Remodularization
• Scalability
• Automated reverse transformation needed
– Minimizing the adoption risk
– On-demand remodularization
Remodularization as a Multi-Objective Optimization Problem
• Automatically relocating classes to optimize measurable design-level principles
– Metrics As Fitness Functions criteria
feature non-common reuse
Multi-Objective Grouping Genetic Algorithm
• Evolving a population of package structures
• Pareto-optimality
– Diverse metrics
– Avoiding extremes
• Grouping operators
• Resulting designs established (and reversed) using automated code transformations
Evaluation
JHotDraw SVG + 3 others Revisiting NDVis– Manual vs. Automated
– Role of reconceptualization
0
0.005
0.01
0.015
0.02
0.025
0.03
fsca
Feature
JHotDraw SVGScattering -55%
Original
Automated
0
0.005
0.01
0.015
0.02
0.025
0.03
0.035
0.04
0.045
fta
ng
Package
JHotDraw SVGTangling -60%
Original
Automated
0
0.05
0.1
0.15
0.2
0.25
0.05 0.1 0.15 0.2 0.25 0.3
FT
AN
G
FSCA
NDVisScattering and Tangling
Original
Manual
Automated
Manual+Automated
Automated split
Automating Measurement of Features
Towards Feature-Oriented Quality Assessment
• For usage in benchmarks, feature-oriented measurement needs to be adapted to:
– Scaling to hundreds of large-scale systems
– Assuming only source code available
Automated Detection of Seed Methods
• Execution tracing static call-graph slicing
• Feature-entry points Automatically detected Anonymous seed methods
keyPressed
actio
nP
erfo
rme
d
getPresentationName
wrapViewComponent• Detection heuristic:
– Method with popular names• Exploits regularity
– Methods yielding large slices• Filters ‘shallow’ methods
Evaluation
1. Assessing extent and accuracy of coverage
• Ground truth constructed from14 diverse OSS
– Apart from expected, the method detected application-specific abstractions
Intersection79%
Method-only6%
Non-covered13%
GT-only2%
2. Measured scattering and tangling in Checkstyleover 10 years (27 releases) period
Conclusions
Open Questions and Future Directions
• Further empirical evaluation of the approach
• Continuous analysis and remodularization
• Featureous within software lifecycle
• Involving 3rd-party application authors
• Towards general on-demand remodularization
– Other concern dimensions needed
Conclusions
• Featureous delivers practical means of:
– Feature location based on feature-entry points
– Structured feature-oriented analysis
– Manual and automated remodularization
• Applicable to existing unfamiliar systems
• Real-world migration to feature-oriented modularizations feasible
– Mix automated and manual
Q&A
[Backup slides]
Featureous Workbench Design
Remodularization workbench
Feature trace model
TraceModel
featureID: String
Type
signature: String package: String instances: Set<String>
*
Execution
signature: String featureEntryPoint: boolean constructor: boolean executionCount: int
Invocation
*
*
callee
enclosingType
caller
Application: tracking evolution of feature confinement
• Checkstyle, 10 years, 27 releases: 1.0 – 5.4– Violation detectors are the features
• Scattering and tangling calibrated on 55 systems
Architectural restructuring
No erosion despite 2x
growth in LOC
Removal of J2EE detectors, refactorings –less tangling
more scattering
Details of Manual vs. Automatic
0
0.01
0.02
0.03
0.04
0.05
0.06
0.07
fsca
Feature
NDVisScattering
Original
Manual
Automated
0
0.005
0.01
0.015
0.02
0.025
0.03
0.035
0.04
0.045
fta
ng
Package
NDVisTangling
Original
Manual
Automated
Results
• Average results:
• Interesting cases:
Intersection79%
Appr.-only6%
Non-covered13%
GT-only2%
k9mail Checkstyle Spring
process verify
invoke
Fragile domain entities