Reverse Engineering Feature Models 
from Software Configurations 
R. AL-msie’deen, M. Huchard, 
A.-D. Seriai, C. Urtado, S. Vauttier 
LIRMM, CNRS et Université de Montpellier 
LGI2P, Ecole des Mines d’Alès 
France 
Oct. 7-10, 2014 
R. AL-msie’deen et al. (LIRMM-LGI2P) Feature Models Oct. 7-10, 2014 1 / 34
1 Context 
2 FCA and feature model 
3 Algorithm 
4 Case study 
5 Conclusion 
R. AL-msie’deen et al. (LIRMM-LGI2P) Feature Models Oct. 7-10, 2014 2 / 34
Context 
1 Context 
2 FCA and feature model 
3 Algorithm 
4 Case study 
5 Conclusion 
R. AL-msie’deen et al. (LIRMM-LGI2P) Feature Models Oct. 7-10, 2014 3 / 34
Context 
Product Line Engineering 
Feature model 
Assets Variable Architecture 
Derived Products 
R. AL-msie’deen et al. (LIRMM-LGI2P) Feature Models Oct. 7-10, 2014 4 / 34
Context 
Building a product 
Feature selection 
Selected Implemented 
Assets Architecture 
Product 
R. AL-msie’deen et al. (LIRMM-LGI2P) Feature Models Oct. 7-10, 2014 5 / 34
Context 
Product Line Reverse Engineering 
Similar Products 
developed in undisciplined manner 
Which Feature model? 
Which Assets? 
Which Architecture? 
R. AL-msie’deen et al. (LIRMM-LGI2P) Feature Models Oct. 7-10, 2014 6 / 34
Context 
Software Product Line 
Feature model 
Assets 
Variable architecture 
Software systems 
R. AL-msie’deen et al. (LIRMM-LGI2P) Feature Models Oct. 7-10, 2014 7 / 34
Context 
Software Product Line Reverse Engineering (REVPLINE) 
R. AL-msie’deen et al. (LIRMM-LGI2P) Feature Models Oct. 7-10, 2014 8 / 34
Context 
Focus: building the feature model 
R. AL-msie’deen et al. (LIRMM-LGI2P) Feature Models Oct. 7-10, 2014 9 / 34
Context 
Feature model 
Classical FODA model: A tree 
R. AL-msie’deen et al. (LIRMM-LGI2P) Feature Models Oct. 7-10, 2014 10 / 34
Context 
Existing approaches 
Acher et al., semi-automatic approach 
Lopez-Herrejon et al., genetic algorithm 
She et al., heuristics based on textual description and given feature 
dependencies 
Ziadi et al., ad hoc algorithm, simpl. intents of Attribute Concepts 
Loesch et al., FCA for understanding variability 
Yang et al., FCA, pruning and merging similar concepts in the concept 
lattice, uses concept specialization for subfeature relationships 
Ryssel et al., FCA (AC-poset), computes FM and complex 
implications, uses specialization between concepts for sub feature 
relationships 
! Find automatically a simple FM model, with cross-tree constraints, no 
hypothetic subfeature relationships 
R. AL-msie’deen et al. (LIRMM-LGI2P) Feature Models Oct. 7-10, 2014 11 / 34
FCA and feature model 
1 Context 
2 FCA and feature model 
3 Algorithm 
4 Case study 
5 Conclusion 
R. AL-msie’deen et al. (LIRMM-LGI2P) Feature Models Oct. 7-10, 2014 12 / 34
FCA and feature model 
Using existing similar software products 
Cell_Phone 
Wireless 
Infrared 
Bluetooth 
Accu_Cell 
Strong 
Medium 
Weak 
Display 
Games 
Multi_Player 
Single_Player 
Artificial_Opponent 
P-1         
P-2         
P-3          
P-4         
P-5        
P-6        
P-7          
P-8          
P-9           
P-10        
P-11          
P-12          
P-13           
P-14           
P-15           
P-16            
R. AL-msie’deen et al. (LIRMM-LGI2P) Feature Models Oct. 7-10, 2014 13 / 34
FCA and feature model 
What reveals FCA: Mandatory features 
R. AL-msie’deen et al. (LIRMM-LGI2P) Feature Models Oct. 7-10, 2014 14 / 34
FCA and feature model 
Features always appearing together 
R. AL-msie’deen et al. (LIRMM-LGI2P) Feature Models Oct. 7-10, 2014 15 / 34
FCA and feature model 
Implications, with different possible semantics 
R. AL-msie’deen et al. (LIRMM-LGI2P) Feature Models Oct. 7-10, 2014 16 / 34
FCA and feature model 
Mutually exclusive, with different possible semantics 
R. AL-msie’deen et al. (LIRMM-LGI2P) Feature Models Oct. 7-10, 2014 17 / 34
FCA and feature model 
Mutually exclusive, with different possible semantics 
R. AL-msie’deen et al. (LIRMM-LGI2P) Feature Models Oct. 7-10, 2014 18 / 34
FCA and feature model 
From FCA information to the feature model 
Used similar software systems are only examples of possible products 
and may contain flaws 
Only hypotheses can be found in the concept lattice or AOC-poset 
For each extracted knowledge, one has to choose wether: 
it will be in the tree or 
it will be encoded into cross-tree constraints 
Choose the form of the tree (which kind of nodes, how many levels) 
R. AL-msie’deen et al. (LIRMM-LGI2P) Feature Models Oct. 7-10, 2014 19 / 34
Algorithm 
1 Context 
2 FCA and feature model 
3 Algorithm 
4 Case study 
5 Conclusion 
R. AL-msie’deen et al. (LIRMM-LGI2P) Feature Models Oct. 7-10, 2014 20 / 34
Algorithm 
Extracting base features 
R. AL-msie’deen et al. (LIRMM-LGI2P) Feature Models Oct. 7-10, 2014 21 / 34
Algorithm 
Extracting AND feature nodes 
R. AL-msie’deen et al. (LIRMM-LGI2P) Feature Models Oct. 7-10, 2014 22 / 34
Algorithm 
Extracting XOR feature node 
R. AL-msie’deen et al. (LIRMM-LGI2P) Feature Models Oct. 7-10, 2014 23 / 34
Algorithm 
Extracting OR feature node 
R. AL-msie’deen et al. (LIRMM-LGI2P) Feature Models Oct. 7-10, 2014 24 / 34
Algorithm 
Extracting require cross-tree constraints 
R. AL-msie’deen et al. (LIRMM-LGI2P) Feature Models Oct. 7-10, 2014 25 / 34
Algorithm 
Extracting exclude cross-tree constraints 
R. AL-msie’deen et al. (LIRMM-LGI2P) Feature Models Oct. 7-10, 2014 26 / 34
Algorithm 
The resulting feature model 
R. AL-msie’deen et al. (LIRMM-LGI2P) Feature Models Oct. 7-10, 2014 27 / 34
Case study 
1 Context 
2 FCA and feature model 
3 Algorithm 
4 Case study 
5 Conclusion 
R. AL-msie’deen et al. (LIRMM-LGI2P) Feature Models Oct. 7-10, 2014 28 / 34
Case study 
Case study 
Derived products from existing SPL 
Existing feature models for expert comparison 
Correctness (precision / recall) is evaluated by comparing products 
generated by the computed FM and initial products 
R. AL-msie’deen et al. (LIRMM-LGI2P) Feature Models Oct. 7-10, 2014 29 / 34
Case study 
Results 
Group of Features CTCs Evaluation Metrics 
# case study 
Number of Products 
Number of Features 
Base 
Atomic Set of Features 
Inclusive-or 
Exclusive-or 
Requires 
Excludes 
Execution times (in ms) 
Precision 
Recall 
F-Measure 
1 ArgoUML-SPL 20 11    509 60% 100% 75% 
3 Graph product line 8 18      551 62% 100% 76% 
4 Berkeley DB 10 43       661 50% 100% 66% 
2 Mobile media 8 18    441 68% 100% 80% 
3 Health complaint-SPL 10 16     439 57% 100% 72% 
4 Video on demand 16 12     572 66% 100% 80% 
5 Wiki engines 8 21       555 54% 100% 70% 
7 Wikipedia 10 14     552 72% 100% 84% 
5 Mobile phone 5 5    406 70% 100% 82% 
6 DC motor 10 15   444 83% 100% 90% 
7 Cell phone-SPL 16 13       486 51% 100% 68% 
R. AL-msie’deen et al. (LIRMM-LGI2P) Feature Models Oct. 7-10, 2014 30 / 34
Conclusion 
1 Context 
2 FCA and feature model 
3 Algorithm 
4 Case study 
5 Conclusion 
R. AL-msie’deen et al. (LIRMM-LGI2P) Feature Models Oct. 7-10, 2014 31 / 34
Conclusion 
Conclusion 
A method which computes a simple FM model from product 
configurations 
Admits all initial product configurations 
Focused on logical organization 
With cross-tree constraints 
No hypothetic sub-feature relationships 
R. AL-msie’deen et al. (LIRMM-LGI2P) Feature Models Oct. 7-10, 2014 32 / 34
Conclusion 
Perspectives 
Use information from source code and FCA for extracting sub-features 
(tree structure) 
Improve XOR computation (compute several) 
Compute covering sets of features 
Define several alternative orders for computing the tree and evaluate 
them on the case study 
R. AL-msie’deen et al. (LIRMM-LGI2P) Feature Models Oct. 7-10, 2014 33 / 34
Conclusion 
Thank you! 
R. AL-msie’deen et al. (LIRMM-LGI2P) Feature Models Oct. 7-10, 2014 34 / 34

Reverse Engineering Feature Models from Software Configurations

  • 1.
    Reverse Engineering FeatureModels from Software Configurations R. AL-msie’deen, M. Huchard, A.-D. Seriai, C. Urtado, S. Vauttier LIRMM, CNRS et Université de Montpellier LGI2P, Ecole des Mines d’Alès France Oct. 7-10, 2014 R. AL-msie’deen et al. (LIRMM-LGI2P) Feature Models Oct. 7-10, 2014 1 / 34
  • 2.
    1 Context 2FCA and feature model 3 Algorithm 4 Case study 5 Conclusion R. AL-msie’deen et al. (LIRMM-LGI2P) Feature Models Oct. 7-10, 2014 2 / 34
  • 3.
    Context 1 Context 2 FCA and feature model 3 Algorithm 4 Case study 5 Conclusion R. AL-msie’deen et al. (LIRMM-LGI2P) Feature Models Oct. 7-10, 2014 3 / 34
  • 4.
    Context Product LineEngineering Feature model Assets Variable Architecture Derived Products R. AL-msie’deen et al. (LIRMM-LGI2P) Feature Models Oct. 7-10, 2014 4 / 34
  • 5.
    Context Building aproduct Feature selection Selected Implemented Assets Architecture Product R. AL-msie’deen et al. (LIRMM-LGI2P) Feature Models Oct. 7-10, 2014 5 / 34
  • 6.
    Context Product LineReverse Engineering Similar Products developed in undisciplined manner Which Feature model? Which Assets? Which Architecture? R. AL-msie’deen et al. (LIRMM-LGI2P) Feature Models Oct. 7-10, 2014 6 / 34
  • 7.
    Context Software ProductLine Feature model Assets Variable architecture Software systems R. AL-msie’deen et al. (LIRMM-LGI2P) Feature Models Oct. 7-10, 2014 7 / 34
  • 8.
    Context Software ProductLine Reverse Engineering (REVPLINE) R. AL-msie’deen et al. (LIRMM-LGI2P) Feature Models Oct. 7-10, 2014 8 / 34
  • 9.
    Context Focus: buildingthe feature model R. AL-msie’deen et al. (LIRMM-LGI2P) Feature Models Oct. 7-10, 2014 9 / 34
  • 10.
    Context Feature model Classical FODA model: A tree R. AL-msie’deen et al. (LIRMM-LGI2P) Feature Models Oct. 7-10, 2014 10 / 34
  • 11.
    Context Existing approaches Acher et al., semi-automatic approach Lopez-Herrejon et al., genetic algorithm She et al., heuristics based on textual description and given feature dependencies Ziadi et al., ad hoc algorithm, simpl. intents of Attribute Concepts Loesch et al., FCA for understanding variability Yang et al., FCA, pruning and merging similar concepts in the concept lattice, uses concept specialization for subfeature relationships Ryssel et al., FCA (AC-poset), computes FM and complex implications, uses specialization between concepts for sub feature relationships ! Find automatically a simple FM model, with cross-tree constraints, no hypothetic subfeature relationships R. AL-msie’deen et al. (LIRMM-LGI2P) Feature Models Oct. 7-10, 2014 11 / 34
  • 12.
    FCA and featuremodel 1 Context 2 FCA and feature model 3 Algorithm 4 Case study 5 Conclusion R. AL-msie’deen et al. (LIRMM-LGI2P) Feature Models Oct. 7-10, 2014 12 / 34
  • 13.
    FCA and featuremodel Using existing similar software products Cell_Phone Wireless Infrared Bluetooth Accu_Cell Strong Medium Weak Display Games Multi_Player Single_Player Artificial_Opponent P-1 P-2 P-3 P-4 P-5 P-6 P-7 P-8 P-9 P-10 P-11 P-12 P-13 P-14 P-15 P-16 R. AL-msie’deen et al. (LIRMM-LGI2P) Feature Models Oct. 7-10, 2014 13 / 34
  • 14.
    FCA and featuremodel What reveals FCA: Mandatory features R. AL-msie’deen et al. (LIRMM-LGI2P) Feature Models Oct. 7-10, 2014 14 / 34
  • 15.
    FCA and featuremodel Features always appearing together R. AL-msie’deen et al. (LIRMM-LGI2P) Feature Models Oct. 7-10, 2014 15 / 34
  • 16.
    FCA and featuremodel Implications, with different possible semantics R. AL-msie’deen et al. (LIRMM-LGI2P) Feature Models Oct. 7-10, 2014 16 / 34
  • 17.
    FCA and featuremodel Mutually exclusive, with different possible semantics R. AL-msie’deen et al. (LIRMM-LGI2P) Feature Models Oct. 7-10, 2014 17 / 34
  • 18.
    FCA and featuremodel Mutually exclusive, with different possible semantics R. AL-msie’deen et al. (LIRMM-LGI2P) Feature Models Oct. 7-10, 2014 18 / 34
  • 19.
    FCA and featuremodel From FCA information to the feature model Used similar software systems are only examples of possible products and may contain flaws Only hypotheses can be found in the concept lattice or AOC-poset For each extracted knowledge, one has to choose wether: it will be in the tree or it will be encoded into cross-tree constraints Choose the form of the tree (which kind of nodes, how many levels) R. AL-msie’deen et al. (LIRMM-LGI2P) Feature Models Oct. 7-10, 2014 19 / 34
  • 20.
    Algorithm 1 Context 2 FCA and feature model 3 Algorithm 4 Case study 5 Conclusion R. AL-msie’deen et al. (LIRMM-LGI2P) Feature Models Oct. 7-10, 2014 20 / 34
  • 21.
    Algorithm Extracting basefeatures R. AL-msie’deen et al. (LIRMM-LGI2P) Feature Models Oct. 7-10, 2014 21 / 34
  • 22.
    Algorithm Extracting ANDfeature nodes R. AL-msie’deen et al. (LIRMM-LGI2P) Feature Models Oct. 7-10, 2014 22 / 34
  • 23.
    Algorithm Extracting XORfeature node R. AL-msie’deen et al. (LIRMM-LGI2P) Feature Models Oct. 7-10, 2014 23 / 34
  • 24.
    Algorithm Extracting ORfeature node R. AL-msie’deen et al. (LIRMM-LGI2P) Feature Models Oct. 7-10, 2014 24 / 34
  • 25.
    Algorithm Extracting requirecross-tree constraints R. AL-msie’deen et al. (LIRMM-LGI2P) Feature Models Oct. 7-10, 2014 25 / 34
  • 26.
    Algorithm Extracting excludecross-tree constraints R. AL-msie’deen et al. (LIRMM-LGI2P) Feature Models Oct. 7-10, 2014 26 / 34
  • 27.
    Algorithm The resultingfeature model R. AL-msie’deen et al. (LIRMM-LGI2P) Feature Models Oct. 7-10, 2014 27 / 34
  • 28.
    Case study 1Context 2 FCA and feature model 3 Algorithm 4 Case study 5 Conclusion R. AL-msie’deen et al. (LIRMM-LGI2P) Feature Models Oct. 7-10, 2014 28 / 34
  • 29.
    Case study Casestudy Derived products from existing SPL Existing feature models for expert comparison Correctness (precision / recall) is evaluated by comparing products generated by the computed FM and initial products R. AL-msie’deen et al. (LIRMM-LGI2P) Feature Models Oct. 7-10, 2014 29 / 34
  • 30.
    Case study Results Group of Features CTCs Evaluation Metrics # case study Number of Products Number of Features Base Atomic Set of Features Inclusive-or Exclusive-or Requires Excludes Execution times (in ms) Precision Recall F-Measure 1 ArgoUML-SPL 20 11 509 60% 100% 75% 3 Graph product line 8 18 551 62% 100% 76% 4 Berkeley DB 10 43 661 50% 100% 66% 2 Mobile media 8 18 441 68% 100% 80% 3 Health complaint-SPL 10 16 439 57% 100% 72% 4 Video on demand 16 12 572 66% 100% 80% 5 Wiki engines 8 21 555 54% 100% 70% 7 Wikipedia 10 14 552 72% 100% 84% 5 Mobile phone 5 5 406 70% 100% 82% 6 DC motor 10 15 444 83% 100% 90% 7 Cell phone-SPL 16 13 486 51% 100% 68% R. AL-msie’deen et al. (LIRMM-LGI2P) Feature Models Oct. 7-10, 2014 30 / 34
  • 31.
    Conclusion 1 Context 2 FCA and feature model 3 Algorithm 4 Case study 5 Conclusion R. AL-msie’deen et al. (LIRMM-LGI2P) Feature Models Oct. 7-10, 2014 31 / 34
  • 32.
    Conclusion Conclusion Amethod which computes a simple FM model from product configurations Admits all initial product configurations Focused on logical organization With cross-tree constraints No hypothetic sub-feature relationships R. AL-msie’deen et al. (LIRMM-LGI2P) Feature Models Oct. 7-10, 2014 32 / 34
  • 33.
    Conclusion Perspectives Useinformation from source code and FCA for extracting sub-features (tree structure) Improve XOR computation (compute several) Compute covering sets of features Define several alternative orders for computing the tree and evaluate them on the case study R. AL-msie’deen et al. (LIRMM-LGI2P) Feature Models Oct. 7-10, 2014 33 / 34
  • 34.
    Conclusion Thank you! R. AL-msie’deen et al. (LIRMM-LGI2P) Feature Models Oct. 7-10, 2014 34 / 34