an overview of techniques for detecting software
play

An Overview of Techniques for Detecting Software Variability - PowerPoint PPT Presentation

1/30 An Overview of Techniques for Detecting Software Variability Concepts in Source Code Angela Lozano Universit catholique de Louvain, Belgium Monday 5 December 2011 2/30 Variability Customized and Affordable Maximize reuse of


  1. 1/30 An Overview of Techniques for Detecting Software Variability Concepts in Source Code Angela Lozano Université catholique de Louvain, Belgium Monday 5 December 2011

  2. 2/30 Variability • Customized and Affordable • Maximize reuse of common features • e.g. reuse hw. customize with sw. • e.g. sw families = { similar apps with shared provenance } • e.g. context-aware, fault tolerant and intelligent apps Monday 5 December 2011

  3. 3/30 Why mining for variability? - Scattering & tangling of vp ʼ s & Fs - pull-up Fs to the core or push down Fs because they are variable • To recuperate from architectural degradation  ♻ • To expand a successful single product to new markets ↔ ↕ possible variable features • Cost-benefit assessment of variation ⚖ -over-generalization vs. over-trivialization ( cost of a making a F variable) -Evaluate != variability mechanisms (flexibility vs. performance • Effect of a variation in the development of the product  - Trace variability REQ -> IMPL - Explicit dependencies - Appropriateness of binding times & variability mechanisms (flexibility vs. Monday 5 December 2011

  4. 4/30 Single vs. Multiple features Variable features Feature Diagram Feature dependencies Mandatory vs. Optional features Feature Variability Optional vs. Alternative variants Variants Binding Variation points Domain instances Monday 5 December 2011

  5. 4/30 Variable features Domain instances Single vs. Multiple features Feature Mandatory vs. Optional features Variability Feature Diagram Variants Optional vs. Alternative variants Binding Variation points Feature dependencies Monday 5 December 2011

  6. 5/30 Car Transmission Engine Extras Suspension Air Car Horsepower Automatic Electric Gasoline Cruise Conditioning executive car Transmission Engine Extras Suspension Automatic Electric Cruise eco-aware car Car Transmission Engine Extras Suspension Car Air Horsepower Manual Gasoline Cruise Transmission Engine Suspension Conditioning motor-head car Gasoline Manual basic car some products of the same domain Feature: unit/increment of functionality Monday 5 December 2011

  7. Car 6/30 Transmission Engine Suspension Car Mining products of Gasoline Manual Transmission Engine Extras Suspension Air Horsepower Automatic Electric Gasoline Cruise Conditioning Car Transmission Engine Extras Suspension Car the same domain Automatic Electric Cruise Transmission Engine Extras Suspension Air Horsepower Manual Gasoline Cruise Conditioning Which parts of #ifdef UNIX UNIX DOS X_win BSD !BSD code are chosen ...I ... X I #endif X X II by which triggers: #if defined (X_win) Code that X X III && ! defined (BSD) selection of X X IV varies ...II... X V variants #endif #ifdef DOS #ifdef X_win Variables ...III... Which trigers that trigger #endif are subsumed by #ifdef BSD changes ...IV... other triggers: #endif ...V... dependencies #endif ⚖  [Snelting TOSEM 96] X: No relation with features X: Need a specific syntax for the configuration of the products X: A trigger does not necessarily store the selection of a variant Monday 5 December 2011

  8. Car 7/30 Transmission Engine Suspension Car Mining products of Gasoline Manual Transmission Engine Extras Suspension Air Horsepower Automatic Electric Gasoline Cruise Conditioning Car Transmission Engine Extras Suspension Car the same domain Automatic Electric Cruise Transmission Engine Extras Suspension Air Horsepower Manual Gasoline Cruise Conditioning Count same signatures for classes Missing methods Name of a with similar names in the class: Class Table 1: Exemplary interface recommendations. Search Term(s) Averaged Interface # 20 common push(int):void; Deck Deck ≈ 50 msec 55 shuffle():void; functionality 3 , 238 results 23 dealCard():Card; Database 323 methods toString():String; 19 17 getCard():Card; 16 cardsLeft():int; of classes main(String[]):void; 10 CreditCard CreditCard & their ≈ 40 msec 30 getNumber():String; Some occasional 1 , 148 results getCardNumber():String; 22 229 methods 20 toString():String; methods 13 setCardNumber(String):void; methods: getCardType():String; 13 (OSS) 12 setNumber(String):void; variants? [Hummel RSSE 10] ↔ ↕ X: Business-specific concepts are likely to be missing in the database. Monday 5 December 2011

  9. 8/30 Variable features Domain instances Single vs. Multiple features Feature Mandatory vs. Optional features Variability Feature Diagram Variants Optional vs. Alternative variants Binding Variation points Feature dependencies Monday 5 December 2011

  10. 9/30 Car Transmission Engine Extras Suspension Air Car Horsepower Automatic Electric Gasoline Cruise Conditioning executive car Transmission Engine Extras Suspension Automatic Electric Cruise eco-aware car Car Transmission Engine Extras Suspension Car Air Horsepower Manual Gasoline Cruise Transmission Engine Suspension Conditioning motor-head car Gasoline Manual basic car Feature: unit/increment of functionality Required in all (Mandatory) or in some (Optional) products Monday 5 December 2011

  11. 10/30 Car Transmission Engine Extras Suspension Air Car Horsepower Automatic Electric Gasoline Cruise Conditioning executive car Transmission Engine Extras Suspension Automatic Electric Cruise eco-aware car Car Transmission Engine Extras Suspension Car Air Horsepower Manual Gasoline Cruise Transmission Engine Suspension Conditioning motor-head car Gasoline Manual basic car Feature: unit/increment of functionality Required in all (Mandatory) or in some (Optional) products Variable: if customization is required Monday 5 December 2011

  12. 11/30 Car Transmission Engine Extras Suspension Air Car Horsepower Automatic Electric Gasoline Cruise Conditioning executive car Transmission Engine Extras Suspension Automatic Electric Cruise eco-aware car Car Transmission Engine Extras Suspension Car Air Horsepower Manual Gasoline Cruise Transmission Engine Suspension Conditioning motor-head car Gasoline Manual basic car Feature: unit/increment of functionality Required in all (Mandatory) or in some (Optional) products Variable: if customization is required Variant: option available for a variable feature Monday 5 December 2011

  13. 12/30 Car Transmission Engine Extras Suspension Air Car Horsepower Automatic Electric Gasoline Cruise Conditioning executive car Transmission Engine Extras Suspension Automatic Electric Cruise eco-aware car Car Transmission Engine Extras Suspension Car Air Horsepower Manual Gasoline Cruise Transmission Engine Suspension Conditioning motor-head car Gasoline Manual basic car Feature: unit/increment of functionality Required in all (Mandatory) or in some (Optional) products Variable: if customization is required Can a variable feature have several variants? YES: Multiple / NO: Single Variant: option available for a variable feature YES: Mutually inclusive / NO:Mutually exclusive Monday 5 December 2011

  14. 13/30 Car Mining for variable & Transmission Engine Extras Suspension Air Horsepower Automatic Manual Electric Gasoline Cruise Conditioning mandatory features Several U tilization = Users of the SCE L ength = LOC products of C omplexity = McCabe the same Metrics per SCE V olatility = 0.7 * changes last year + 0.3 * exp. changes this year domain - Placement of a S pecificity = LOCs per variation SCE: M itosis = % clone differences Their local layer mandatory/ source C V optional features, U regional layer S code L M C repository global layer [Faust SPE 03] ♻ X: Cannot identify dependencies X: No support for refactoring Monday 5 December 2011

  15. 14/30 Car Mining for variable & Transmission Engine Extras Suspension Air Horsepower Automatic Manual Electric Gasoline Cruise Conditioning mandatory features clone detection → candidate functions One Metrics per SCE - product of max(|f1|, |f2|)-LD(f1,f2) How to merge a sim (f1,f2) = |f1| the domain variant into the LD = Levenshtein Distance basic product: FI: Identical Functions (sim=1) App. w. basic mandatory/ FS: Similar Functions (0<sim<1) functionality of |FI| = 1: Identical correspondence optional functions, |FI| > 1: Multiple correspondence the domain |FI| = 0 & |FS| = 1: Single variant single/multiple |FI| = 0 & |FS| > 1: Multiple variant (core of the variable features |FI| = 0 & |FS| =0: No correspondence line) [Mende CSMR 04] ♻ X: No support for non-corresponding code X: Cannot identify dependencies X: No link to feature diagram Monday 5 December 2011

Recommend


More recommend