This document proposes an approach to automatically detect "seed methods" for quantifying feature confinement in object-oriented programs. Seed methods are starting points of feature control flows. The approach ranks methods based on popular names and size of static control flow slices. It was evaluated on 14 Java programs against ground truth slices, finding 79% intersection on average. The approach was also applied to track how feature confinement in Checkstyle evolved over 10 years and 27 releases, despite a doubling of lines of code.
Top IPTV Subscription Service to Stream Your Favorite Shows in 2024.pdf
Detection of Seed Methods for Quantification of Feature Confinement
1. Detection of Seed Methods for
Quantification of Feature Confinement
Andrzej Olszak, Eric Bouwers,
Bo Nørregaard Jørgensen, Joost Visser
2. Agenda
I. Features in OO programs
II. Feature-centric quality assessment
III. Our approach
I. Seed methods
II. Automated detection of seed methods
IV. Evaluation
V. Evolutionary application
VI. Conclusion
—2—
3. Features
• Feature is a unit of user functionality
– Bridges the problem and solution domains
– Unit of evolutionary change
4. Features in OO programs
Feature specs Source code
• Crosscutting inter-class collaborations
• Implicit boundaries
5. Features in OO programs
Feature specs Source code
• Crosscutting inter-class collaborations
• Implicit boundaries
6. Features in OO programs
Feature specs Source code
scattering
• Crosscutting inter-class collaborations
• Implicit boundaries
• More scattering = bigger scope of change
7. Features in OO programs
Feature specs Source code
tangling
scattering
• Crosscutting inter-class collaborations
• Implicit boundaries
• More scattering = bigger scope of change
• More tangling = more change propagation
8. Feature-centric quality
assessment
• Scaling quantification of feature confinement:
– Hundreds of large-scale industrial systems
– Mixed availability of documentation, issue
tracker tickets, full revision histories…
– System-level ratings
• Existing feature location approaches are
insufficient and needlessly fine-grained
9. Our approach – seed methods
• Features as user-triggered control flows
:JButton :ActionListener :Model
Feature Seed Method
actionPerformed()
Program
Swing
…
• Seed methods are the starting points of
feature control graphs
10. Our approach – automated
detection of seed methods
• Automated detection of seeds for static slicing
– Anonymous seed methods
• Rank methods Product of two simple heuristics:
– Method with popular names
• Exploits regularity, i.e. polymorphism-based callbacks
– Methods that yield large static control-flow slices
• Filters uninteresting shallow methods, e.g. toString, getID
• Take δ=10 best methods*
20. A more realistic example:
JHotDraw 7.6
wrapViewComponent
keyPressed
actionPerformed
getPresentationName
21. Evaluation
• Hypothesis:
– Traces produced by our approach cover the same
regions of source code as a ground truth
• Ground-truth slices based on manually
constructed set of seed methods:
– 14 medium and large Java programs
– Based on used interfacing technologies, e.g.
Swing, SWT, Android, Spring
23. Results
• Average results:
Non-covered GT-only
13% 2%
Appr.-only
6%
Intersection
79%
• Interesting cases:
k9mail Checkstyle Spring
invoke
process
verify
24. 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
25. 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
26. 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
27. 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 Removal of
J2EE detectors,
refactorings
No erosion
despite 2x
growth in LOC
28. Conclusion
• Seed methods detection:
– Detected approximate the ground truth
– We find solution-specific abstractions
• Interesting perspective on software evolution
• Persisting challenges:
– Heuristic parameters and some design decisions
(δ=10, product, ranking)
– Comparative validation vs. traditional approaches