detection of seed methods for quantification of feature confinement

29
Detection of Seed Methods for Quantification of Feature Confinement Andrzej Olszak, Eric Bouwers, Bo Nørregaard Jørgensen, Joost Visser

Upload: andrzej-olszak

Post on 21-Jul-2015

123 views

Category:

Entertainment & Humor


0 download

TRANSCRIPT

Detection of Seed Methods for Quantification of Feature Confinement

Andrzej Olszak, Eric Bouwers,

Bo Nørregaard Jørgensen, Joost Visser

Agenda

I. Features in OO programsII. Feature-centric quality assessmentIII. Our approach

I. Seed methodsII. Automated detection of seed methods

IV. EvaluationV. Evolutionary applicationVI. Conclusion

— 2 —

Features

• Feature is a unit of user functionality– Bridges the problem and solution domains

– Unit of evolutionary change

Feature specs Source code

Features in OO programs

• Crosscutting inter-class collaborations• Implicit boundaries

Feature specs Source code

Features in OO programs

• Crosscutting inter-class collaborations• Implicit boundaries

Feature specs Source code

Features in OO programs

• Crosscutting inter-class collaborations• Implicit boundaries• More scattering = bigger scope of change

scattering

Feature specs Source code

Features in OO programs

• Crosscutting inter-class collaborations• Implicit boundaries• More scattering = bigger scope of change• More tangling = more change propagation

scattering

tangling

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

Pro

gra

m

Swin

g

Our approach – seed methods

• Features as user-triggered control flows

• Seed methods are the starting points of feature control graphs

Feature Seed MethodactionPerformed()

:ActionListener :Model:JButton

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*

Automated detection of seed methods - example

Automated detection of seed methods - example

Automated detection of seed methods - example

Automated detection of seed methods - example

2/10

Automated detection of seed methods - example

2/10

Automated detection of seed methods - example

2/10

Automated detection of seed methods - example

2/10

Automated detection of seed methods - example

2/10

avg(5/10, 4/10)

Automated detection of seed methods - example

2/10

avg(5/10, 4/10)

0.2 * 0.45

A more realistic example:JHotDraw 7.6

keyPressed

actionPerformed

getPresentationName

wrapViewComponent

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

Ground truth

Results

• Average results:

• Interesting cases:

Intersection79%

Appr.-only6%

Non-covered13%

GT-only2%

k9mail Checkstyle Spring

process verify

invoke

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

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

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

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

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

Q&A