FHistorian: Locating Features in Version Histories
Yi Li / UToronto Chenguang Zhu / UToronto Julia Rubin / UBC Marsha Chechik / UToronto Sep 27, 2017
FHistorian: Locating Features in Version Histories Yi Li / - - PowerPoint PPT Presentation
FHistorian: Locating Features in Version Histories Yi Li / UToronto Chenguang Zhu / UToronto Julia Rubin / UBC Marsha Chechik / UToronto Sep 27, 2017 Feature Location Feature location is the activity of identifying an initial location
Yi Li / UToronto Chenguang Zhu / UToronto Julia Rubin / UBC Marsha Chechik / UToronto Sep 27, 2017
“Feature location is the activity of identifying an initial location in the source code that implements functionality in a software system.”
Dit, B., Revelle, M., Gethers, M. and Poshyvanyk, D. (2013), Feature location in source code: a taxonomy and
2
3
core assets (features) configurations + feature model product outputs The “top-down” approach
3
core assets (features) configurations + feature model product outputs product variants The “top-down” approach The “bottom-up” approach
3
core assets (features) configurations + feature model product outputs
f1 f2 f4 f3
(feature models) f1: f2: f3: f4:
(assets) product variants
From “ad-hoc” to “systematic”
The “top-down” approach The “bottom-up” approach
4
Variant 1 Variant 2 Variant n-1 Variant n
…
f1, f2, f3 f1, f3 f1, f2, f4 f1, f3, f5
4
Variant 1 Variant 2 Variant n-1 Variant n
…
f1, f2, f3 f1, f3 f1, f2, f4 f1, f3, f5
code elements
4
Variant 1 Variant 2 Variant n-1 Variant n
…
f1, f2, f3 f1, f3 f1, f2, f4 f1, f3, f5 Intersection-based feature location
code elements
4
Variant 1 Variant 2 Variant n-1 Variant n
…
f1, f2, f3 f1, f3 f1, f2, f4 f1, f3, f5 Intersection-based feature location
code elements
4
Variant 1 Variant 2 Variant n-1 Variant n
…
f1, f2, f3 f1, f3 f1, f2, f4 f1, f3, f5 Intersection-based feature location
code elements
f4 f1 f3 f2 f5
4
Variant 1 Variant 2 Variant n-1 Variant n
…
f1, f2, f3 f1, f3 f1, f2, f4 f1, f3, f5 Intersection-based feature location f1: f2: f3: f4: f5:
code elements
f4 f1 f3 f2 f5
4
Variant 1 Variant 2 Variant n-1 Variant n
…
f1, f2, f3 f1, f3 f1, f2, f4 f1, f3, f5 Intersection-based feature location f1: f2: f3: f4: f5:
code elements
f4 f1 f3 f2 f5
What if: Variant 1 also has f6 and f7?
Intersection-based FL:
number of variants
exhaustive
5
Intersection-based FL:
number of variants
exhaustive
Reality:
systems (e.g., Git)
5
6
master feature 2 feature 3 feature 4 feature 1 test 1 test 4 test 2 test 3
6
New features: {f1, f2, f3, f4}, tests: {t1,t2,t3,t4}
master feature 2 feature 3 feature 4 feature 1 test 1 test 4 test 2 test 3
6
New features: {f1, f2, f3, f4}, tests: {t1,t2,t3,t4} f1: f2: f3: f4:
master feature 2 feature 3 feature 4 feature 1
commits
test 1 test 4 test 2 test 3
6
New features: {f1, f2, f3, f4}, tests: {t1,t2,t3,t4} f1: f2: f3: f4:
master feature 2
f1 f2 f4 f3
feature 3 feature 4 feature 1
commits features
test 1 test 4 test 2 test 3
History-based dynamic feature location
7
History-based dynamic feature location
7
History-based dynamic feature location
within a history range
7
8
(H)istory (T)ests H ⊨ T
T1, T2
9
(H)istory (T)ests H ⊨ T
T1, T2 T1, T2
9
Remove!
(H)istory (T)ests H ⊨ T
T1, T2 T1, T2 T1
9
(H)istory (T)ests H ⊨ T
T1, T2 T1, T2 T1 T2
9
(H)istory (T)ests H ⊨ T
T1, T2 T1, T2 T1 T2
9
Minimal semantics-preserving slice = feature implementing changes?
http://www.cs.toronto.edu/~liyi/cslicer [ASE’16]
X
11
FHISTORIAN
Input History: H
Tfn Tf1
F LOCATE
… Hfn Hf1 …
F H GRAPH
Feature Model:
(F, Er , Ed , h)
11
FHISTORIAN
Input History: H
Tfn Tf1
F LOCATE
… Hfn Hf1 …
F H GRAPH
Feature Model:
(F, Er , Ed , h)
Light-weight
FHISTORIAN
Input History: H
Tfn Tf1
FLOCATE
… Hfn Hf1 …
FHGRAPH
Feature Model:
(F, Er , Ed , h)Based on Definer [ASE’16]
minimal slice: Hf s.t. Hf ⊨ Tf
f = Hf \ Hf’ for all other f’
in paper…)
12
H : Hf1 : Hf2 : Hf3 :
FHISTORIAN
Input History: H
Tfn Tf1
FLOCATE
… Hfn Hf1 …
FHGRAPH
Feature Model:
(F, Er , Ed , h)Based on Definer [ASE’16]
minimal slice: Hf s.t. Hf ⊨ Tf
f = Hf \ Hf’ for all other f’
in paper…)
12
H : Hf1 : Hf2 : Hf3 : f1 :
FHISTORIAN
Input History: H
Tfn Tf1
FLOCATE
… Hfn Hf1 …
FHGRAPH
Feature Model:
(F, Er , Ed , h)Based on Definer [ASE’16]
minimal slice: Hf s.t. Hf ⊨ Tf
f = Hf \ Hf’ for all other f’
in paper…)
12
H : Hf1 : Hf2 : Hf3 : f2 : f1 :
FHISTORIAN
Input History: H
Tfn Tf1
FLOCATE
… Hfn Hf1 …
FHGRAPH
Feature Model:
(F, Er , Ed , h)Based on Definer [ASE’16]
minimal slice: Hf s.t. Hf ⊨ Tf
f = Hf \ Hf’ for all other f’
in paper…)
12
H : Hf1 : Hf2 : Hf3 : f2 : f3 : f1 :
FHISTORIAN
Input History: H
Tfn Tf1
FLOCATE
… Hfn Hf1 …
FHGRAPH
Feature Model:
(F, Er , Ed , h)Light-weight feature model:
Depends-on Reflecting runtime dependencies Relates-to Revealing underlying connections
13
(f2 → f1) ⇔ (Hf1 ⊆ Hf2)
(f2 $ f1) , (Hf1 \ Hf2 6= ;)
Hf1 : Hf2 : Hf3 :
f2 f3 f1
FHISTORIAN
Input History: H
Tfn Tf1
FLOCATE
… Hfn Hf1 …
FHGRAPH
Feature Model:
(F, Er , Ed , h)Light-weight feature model:
Depends-on Reflecting runtime dependencies Relates-to Revealing underlying connections
13
(f2 → f1) ⇔ (Hf1 ⊆ Hf2)
(f2 $ f1) , (Hf1 \ Hf2 6= ;)
Hf1 : Hf2 : Hf3 :
f2 f3 f1
depends-on depends-on
FHISTORIAN
Input History: H
Tfn Tf1
FLOCATE
… Hfn Hf1 …
FHGRAPH
Feature Model:
(F, Er , Ed , h)Light-weight feature model:
Depends-on Reflecting runtime dependencies Relates-to Revealing underlying connections
13
(f2 → f1) ⇔ (Hf1 ⊆ Hf2)
(f2 $ f1) , (Hf1 \ Hf2 6= ;)
Hf1 : Hf2 : Hf3 :
f2 f3 f1
relates-to depends-on depends-on
X
FHistorian:
Research questions:
14
Preparing subjects:
with JIRA issue tracking)
15
{f1, f2, . . . , fn}
release notes
Preparing subjects:
with JIRA issue tracking)
15
{f1, f2, . . . , fn} f1
release notes features
Preparing subjects:
with JIRA issue tracking)
15
{f1, f2, . . . , fn} f1 Tf1
release notes features feature tests
Preparing subjects:
with JIRA issue tracking)
15
{f1, f2, . . . , fn} f1 Tf1
release notes features feature tests
Comparing with developer annotations:
notes (not always perfect)
16
Comparing with developer annotations:
notes (not always perfect)
Reasons for the differences:
16
17
relates-to: depends-on:
A B A B
COMPRESS 374 COMPRESS 369 COMPRESS 373 COMPRESS 327 COMPRESS 368 COMPRESS 327’ COMPRESS 373 COMPRESS 369 COMPRESS 374 COMPRESS 368 COMPRESS 360 Seekable
17
Hidden feature Hidden feature
relates-to: depends-on:
A B A B
COMPRESS 374 COMPRESS 369 COMPRESS 373 COMPRESS 327 COMPRESS 368 COMPRESS 327’ COMPRESS 373 COMPRESS 369 COMPRESS 374 COMPRESS 368 COMPRESS 360 Seekable
FHistorian: History-based feature location
What’s next?
18
19
Yi Li University of Toronto liyi@cs.toronto.edu
New features: {f1, f2, f3, f4}, tests: {t1,t2,t3,t4} f1: f2: f3: f4:
master feature 2
f1 f2 f4 f3
feature 3 feature 4 feature 1
commits features
test 1 test 4 test 2 test 3