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 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 survey. J. Softw. Evol. and Proc., 25: 53–95. doi:10.1002/smr.567 2
Feature Location for SPLE The “top-down” approach core assets (features) configurations + feature model product outputs 3
Feature Location for SPLE The “top-down” approach core assets (features) configurations + feature model product variants The “bottom-up” approach product outputs 3
Feature Location for SPLE The “top-down” approach From “ad-hoc” to “systematic” f1: core assets (features) f2: f3: f4: 1. feature implementations (assets) configurations + feature model f4 f3 product variants f1 f2 The “bottom-up” approach 2. feature relationships (feature models) product outputs 3
Feature Location from Product Variants Variant 1 Variant 2 Variant n-1 Variant n … f1, f2, f3 f1, f3 f1, f2, f4 f1, f3, f5 4
Feature Location from Product Variants Variant 1 Variant 2 Variant n-1 Variant n code … elements f1, f2, f3 f1, f3 f1, f2, f4 f1, f3, f5 4
Feature Location from Product Variants Variant 1 Variant 2 Variant n-1 Variant n code … elements f1, f2, f3 f1, f3 f1, f2, f4 f1, f3, f5 Intersection-based feature location 4
Feature Location from Product Variants Variant 1 Variant 2 Variant n-1 Variant n code … elements f1, f2, f3 f1, f3 f1, f2, f4 f1, f3, f5 Intersection-based feature location 4
Feature Location from Product Variants Variant 1 Variant 2 Variant n-1 Variant n code … elements f1, f2, f3 f1, f3 f1, f2, f4 f1, f3, f5 f5 f1 f3 Intersection-based f4 feature location f2 4
Feature Location from Product Variants Variant 1 Variant 2 Variant n-1 Variant n code … elements f1, f2, f3 f1, f3 f1, f2, f4 f1, f3, f5 f5 f1: f2: f1 f3 Intersection-based f4 f3: feature location f2 f4: f5: 4
Feature Location from Product Variants Variant 1 Variant 2 Variant n-1 Variant n code … elements f1, f2, f3 f1, f3 f1, f2, f4 f1, f3, f5 f5 f1: f2: f1 f3 Intersection-based f4 f3: f6? feature location f2 f4: f7? f5: What if: Variant 1 also has f6 and f7? 4
Pitfalls of Intersection-Based Approaches Intersection-based FL: • Only works well with a large number of variants • Operates in static manner • Feature labeling has to be exhaustive 5
Pitfalls of Intersection-Based Approaches Intersection-based FL: • Only works well with a large number of variants • Operates in static manner • Feature labeling has to be exhaustive Reality: • 3~10 products, ~50 features • Maintained in version control systems (e.g., Git) 5
Feature Location in Version Histories master feature 1 test 1 test 4 feature 4 test 2 feature 2 test 3 feature 3 6
Feature Location in Version Histories master feature 1 test 1 test 4 feature 4 test 2 feature 2 test 3 feature 3 New features: {f1, f2, f3, f4} , tests: {t1,t2,t3,t4} 6
Feature Location in Version Histories master feature 1 test 1 test 4 feature 4 test 2 feature 2 test 3 feature 3 New features: {f1, f2, f3, f4} , tests: {t1,t2,t3,t4} f1: f2: f3: commits f4: 6
Feature Location in Version Histories master feature 1 test 1 test 4 feature 4 test 2 feature 2 test 3 feature 3 New features: {f1, f2, f3, f4} , tests: {t1,t2,t3,t4} f1: f4 f3 f2: features f3: f1 f2 commits f4: 6
History-Based vs. Intersection-Based History-based dynamic feature location 7
History-Based vs. Intersection-Based History-based dynamic feature location • More flexible: 1. Implicit feature labeling: release notes 2. Traceability of evolution information 3. Effective even with limited numbers of variants 7
History-Based vs. Intersection-Based History-based dynamic feature location • More flexible: 1. Implicit feature labeling: release notes 2. Traceability of evolution information 3. Effective even with limited numbers of variants • More accurate: 4. Captures runtime dependencies 5. Focused search space: only considering changes within a history range 6. Generates Light-weight feature models 7
Outline 1. Introduction 2. Background - Semantics-Preserving History Slice - Semantic History Slicing 3. FHistorian - FLocate: identifying feature implementations in histories - FHGraph: inferring feature relationships 4. Evaluation 5. Conclusion & Future Work 8
Semantics-Preserving History Slice H ⊨ T (H)istory (T)ests T 1 , T 2 9
Semantics-Preserving History Slice H ⊨ T (H)istory (T)ests T 1 , T 2 Remove! T 1 , T 2 9
Semantics-Preserving History Slice H ⊨ T (H)istory (T)ests T 1 , T 2 T 1 , T 2 T 1 9
Semantics-Preserving History Slice H ⊨ T (H)istory (T)ests T 1 , T 2 T 1 , T 2 T 1 T 2 9
Semantics-Preserving History Slice H ⊨ T (H)istory (T)ests T 1 , T 2 T 1 , T 2 T 1 T 2 Minimal semantics-preserving slice = feature implementing changes? 9
Semantic History Slicing http://www.cs.toronto.edu/~liyi/cslicer [ASE’16]
Outline 1. Introduction 2. Background - Semantics-Preserving History Slice - Semantic History Slicing 3. FHistorian - FLocate: identifying feature implementations in histories - FHGraph: inferring feature relationships 4. Evaluation 5. Conclusion & Future Work X
FHistorian = FLocate + FHGraph Input History: H FH ISTORIAN T f 1 H f 1 G RAPH L OCATE Feature Model: … … ( F , E r , E d , h ) H F F T f n H f n 11
FHistorian = FLocate + FHGraph Input History: H FH ISTORIAN T f 1 H f 1 Light-weight G RAPH L OCATE Feature Model: … … ( F , E r , E d , h ) H F F T f n H f n 11
Input History: H FLocate: Locating Feature FH ISTORIAN T f 1 H f 1 Implementations FHG RAPH FL OCATE Feature Model: … … ( F , E r , E d , h ) T f n H f n Based on Definer [ASE’16] • Foreach feature f, find a minimal slice: H f s.t. H f ⊨ T f • Factoring out other features: f = H f \ H f’ for all other f’ H : • Hunk minimization (details H f 1 : in paper…) H f 2 : H f 3 : 12
Input History: H FLocate: Locating Feature FH ISTORIAN T f 1 H f 1 Implementations FHG RAPH FL OCATE Feature Model: … … ( F , E r , E d , h ) T f n H f n Based on Definer [ASE’16] • Foreach feature f, find a minimal slice: H f s.t. H f ⊨ T f • Factoring out other features: f = H f \ H f’ for all other f’ H : • Hunk minimization (details H f 1 : f 1 : in paper…) H f 2 : H f 3 : 12
Input History: H FLocate: Locating Feature FH ISTORIAN T f 1 H f 1 Implementations FHG RAPH FL OCATE Feature Model: … … ( F , E r , E d , h ) T f n H f n Based on Definer [ASE’16] • Foreach feature f, find a minimal slice: H f s.t. H f ⊨ T f • Factoring out other features: f = H f \ H f’ for all other f’ H : • Hunk minimization (details H f 1 : f 1 : in paper…) H f 2 : f 2 : H f 3 : 12
Input History: H FLocate: Locating Feature FH ISTORIAN T f 1 H f 1 Implementations FHG RAPH FL OCATE Feature Model: … … ( F , E r , E d , h ) T f n H f n Based on Definer [ASE’16] • Foreach feature f, find a minimal slice: H f s.t. H f ⊨ T f • Factoring out other features: f = H f \ H f’ for all other f’ H : • Hunk minimization (details H f 1 : f 1 : in paper…) H f 2 : f 2 : H f 3 : f 3 : 12
Input History: H FHGraph: Inferring Feature FH ISTORIAN T f 1 H f 1 Relationships FHG RAPH FL OCATE Feature Model: … … ( F , E r , E d , h ) T f n H f n Light-weight feature model: H f 2 : H f 3 : Depends-on ( f 2 → f 1 ) ⇔ ( H f 1 ⊆ H f 2 ) f2 f3 Reflecting runtime dependencies Relates-to ( f 2 $ f 1 ) , ( H f 1 \ H f 2 6 = ; ) f1 H f 1 : Revealing underlying connections 13
Input History: H FHGraph: Inferring Feature FH ISTORIAN T f 1 H f 1 Relationships FHG RAPH FL OCATE Feature Model: … … ( F , E r , E d , h ) T f n H f n Light-weight feature model: H f 2 : H f 3 : Depends-on ( f 2 → f 1 ) ⇔ ( H f 1 ⊆ H f 2 ) f2 f3 Reflecting runtime dependencies depends-on depends-on Relates-to ( f 2 $ f 1 ) , ( H f 1 \ H f 2 6 = ; ) f1 H f 1 : Revealing underlying connections 13
Input History: H FHGraph: Inferring Feature FH ISTORIAN T f 1 H f 1 Relationships FHG RAPH FL OCATE Feature Model: … … ( F , E r , E d , h ) T f n H f n Light-weight feature model: H f 2 : H f 3 : Depends-on relates-to ( f 2 → f 1 ) ⇔ ( H f 1 ⊆ H f 2 ) f2 f3 Reflecting runtime dependencies depends-on depends-on Relates-to ( f 2 $ f 1 ) , ( H f 1 \ H f 2 6 = ; ) f1 H f 1 : Revealing underlying connections 13
Outline 1. Introduction 2. Background - Semantics-Preserving History Slice - Semantic History Slicing 3. FHistorian - FLocate: identifying feature implementations in histories - FHGraph: inferring feature relationships 4. Evaluation 5. Conclusion & Future Work X
Recommend
More recommend