Automatic Extraction of Product Line Core Assets
from UML Class Diagram Variants

Wesley K. G. Assunção, Silvia R. Vergilio, Roberto. E. Lopez-Herrejon

This page has additional content for the paper "Automatic Extraction of Product Line Core Assets from UML Class Diagram Variants". We present an illustrative example of inputs and outputs of ModelVars2SPL. We also make available the source code/executables of the tools and the case studies used in the evaluation of ModelVars2SPL.


Illustrative Example

For the illustration of the proposed approach, the figures below present all UML class diagram variants of Bank System (BS) (https://github.com/but4reuse/but4reuse/wiki/Examples). BS is a small banking application that implements four features and is composed of eight variants. BS1 is the simplest variant, which implements only the common operations of the banking system. BS8 is the most complete variant implementing the four features.

(a) BS1: {Base}
(b) BS2: {Base, WithdrawLimit}

 

(c) BS3: {Base, Consortium}
(d) BS4: {Base, Converter}

 

(e) BS5: {Base, Consortium, Converter}
(f) BS6: {Base, WithdrawLimit, Converter}

 

(g) BS7: {Base, WithdrawLimit, Consortium}
(h) BS8: {Base, WithdrawLimit, Cons., Conv.}

 

Next we present and discuss the outputs of each step of ModelVars2SPL.

 

Features Traceability

The table below presents the modules of BS obtained in the Feature Traceability. The module d0(+Base.{0}) represents the mandatory feature Base and it is the feature with the highest number of elements. The modules d1(−Converter.{0}, +Consortium.{0}) OR d1(+Base.{0}, −WithdrawLimit.{0}) represent those elements that are present when the feature Converter is not present and feature Consortium is present, or when the Base is present but WithdrawLimit is not present.

The relationships between modules are represented in a dependency graph, which is illustrated as follows. We can observe that all modules have relationships with the module d0(+Base.{0}), which has the mandatory feature Base. The number of dependencies in the graph is shown by the edge labels. This dependency graph provides information regarding the composition of the variants. For example, if we want to add the feature WithdrawLimit in a variant that has only feature Base, then we need to put seven model elements of d0(+WithdrawLimit.{0}) together d0(+Base.{0}) and remove two elements of the moduled d1(+Base.{0}, −WithdrawLimit.{0}).

 

Reverse Engineering of Feature Models

An example of FM obtained with our approach is illustrated below. This FM is the optimal solution found by NSGA-II for the BS case study. Considering the eight variants of BS, the FM denotes the exact combination of features desired and does not break any dependency of the dependency graph. The tree of the FM is illustrated at the top of the figure, which has one mandatory feature Base, and three optional features Converter, Consortium, and WithdrawLimit. The eight possible combinations of features (i.e., configurations) are presented at the bottom of the figure.

 

Model Merging

To illustrate the output of the Model Merging step, the figure below presents the merged model for the BS case study. This model is a complete class diagram with all the existing elements among the variants. Compared to BS8, which is the variant with all features, this model has represented the absence of features related with the variants without the feature WithdrawLimit. This means that this model provides a better overview of all variants, considering both presence and absence of model elements.

 

Variability Grafting

An example of PLA (i.e., an annotated class diagram) for the BS case study is illustrated in the following. The model is the same of previous step, except from the annotations regarding the variabilities and features. For a sack of illustration, we present annotation of classes, attributes, and operations. The classes Bank, Consortium, and Converter, have their annotations depicted at the bottom of the figure. The annotated attributes accounts, converter, and cons, of the class Bank are illustrated at the top of the figure. The comment annotations for the operations deposit(), withdrawLimit(), and withdrawWithoutLimit() are presented on the right.


Tools

Below we present the source code and executables of the tools used in the experimentation of ModelVars2SPL. Our approach deals with models created with the Eclipse Modeling Framework (EMF). The class diagrams in our approach are represented using EMF-based UML2, which is an implementation of the UML TM 2.x metamodel for the Eclipse platform.

  • Download Features Traceability and Variability Grafting

    The basis to implement the steps of Features Traceability and Variability Grafting was the ECCO tool (https://github.com/jku-isse/ecco). To deal with EMF UML models we developed a parser to decompose class diagrams, allowing ECCO to discover the traceability between features and model elements.

  • Download Reverse Engineering of Feature Models

    The step of Reverse Engineering of Feature Models is based on the Non-Dominated Sorting Genetic Algorithm (NSGA-II). NSGA-II is a Multi-Objective Evolutionary Algorithm widely used to find solution for multi-objective problems. We used the implementation available on the ECJ Framework (http://cs.gmu.edu/~eclab/projects/ecj/).

  • Download Model Merging

    We implemented our Model Merging step using JMetal Framework (http://jmetal.sourceforge.net/) applying the mono-objective generational Genetic Algorithm (gGA).


Case Studies

In the following we make avilable the UML class diagrams of all case studies used in the evaluaton of ModelVars2SPL.The tables present details of the case studies. In each table we present the name of the variants, the features and the number of model elements of each variant. Besides, we also indicate or present the baseline variants used in the experiment.

 

Download Case Studies of Scenario 1 - In this scenario the case studies are composed of variants which implement all possible configurations (i.e., combinations of features). For instance, there are variants which implement few features and a variant which implements the maximum possible number of features.

 

Mobile Media - Version 1 (MMv1)


Features Model Elements









Variant MM IP 132x176 128x149 176x205 Cl Int Attr Op Rel









MMv1_P01 x x x

23 1 22 121 13









MMv1_P02 x x
x
23 1 22 121 13









MMv1_P03 x x

x 23 1 22 121 13









 

Banking System (BS)


Features Model Elements










Variant BS WL CON CC Cl Int Attr Op Rel










BS_01 x


3 0 5 6 1










BS_02 x x

3 0 6 8 1










BS_03 x
x
4 0 6 7 3










BS_04 x

x 4 0 7 11 3










BS_05 x
x x 5 0 8 12 5










BS_06 x x
x 4 0 8 13 3










BS_07 x x x
4 0 7 9 3










BS_08 x x x x 5 0 9 14 4










 

Draw Product Line (DPL)


Features Model Elements








Variant DPL L R C W F Cl Int Attr Op Rel








DPL_P01 x x



4 0 3 26 4








DPL_P02 x x x


5 0 12 37 6








DPL_P03 x
x


4 0 11 29 4








DPL_P04 x x x x

5 0 17 38 6








DPL_P05 x x
x

4 0 8 27 4








DPL_P06 x
x x

4 0 16 30 4








DPL_P07 x x

x
4 0 4 27 4








DPL_P08 x x x
x
5 0 13 38 6








DPL_P09 x
x
x
4 0 12 30 4








DPL_P10 x x x x x
5 0 18 39 6








DPL_P11 x x
x x
9 0 9 69 10








DPL_P12 x
x x x
4 0 17 31 4








DPL_P13 x x x x
x 5 0 19 40 6








DPL_P14 x
x x
x 4 0 18 32 4








DPL_P15 x x x x x x 5 0 20 41 6








DPL_P16 x
x x x x 4 0 19 33 4








 

ZipMe (ZM)


Features Model Elements







Variant ZM C CRC AC GZIP Adler32 E Cl Int Attr Op Rel







ZipMe_00 x x




22 3 183 241 64







ZipMe_01 x x x



23 3 185 251 66







ZipMe_02 x x
x


22 3 183 243 66







ZipMe_03 x x x x


23 3 185 253 68







ZipMe_04 x x

x

25 3 193 263 68







ZipMe_05 x x x
x

26 3 195 282 73







ZipMe_06 x x
x x

25 3 193 265 70







ZipMe_07 x x x x x

26 3 195 284 75







ZipMe_08 x x


x
23 3 185 263 69







ZipMe_09 x x x

x
24 3 187 273 71







ZipMe_10 x x
x
x
23 3 185 265 71







ZipMe_11 x x x x
x
24 3 187 275 73







ZipMe_12 x x

x x
26 3 195 285 73







ZipMe_13 x x x
x x
27 3 197 304 78







ZipMe_14 x x
x x x
26 3 195 287 75







ZipMe_15 x x x x x x
27 3 197 306 80







ZipMe_16 x x



x 23 3 189 262 70







ZipMe_17 x x x


x 24 3 191 279 74







ZipMe_18 x x
x

x 23 3 189 264 72







ZipMe_19 x x x x

x 24 3 191 281 76







ZipMe_20 x x

x
x 26 3 199 284 74







ZipMe_21 x x x
x
x 27 3 201 310 81







ZipMe_22 x x
x x
x 26 3 199 286 76







ZipMe_23 x x x x x
x 27 3 201 312 83







ZipMe_24 x x


x x 24 3 191 284 75







ZipMe_25 x x x

x x 25 3 193 301 79







ZipMe_26 x x
x
x x 24 3 191 286 77







ZipMe_27 x x x x
x x 25 3 193 303 81







ZipMe_28 x x

x x x 27 3 201 306 79







ZipMe_29 x x x
x x x 28 3 203 332 86







ZipMe_30 x x
x x x x 27 3 201 308 81







ZipMe_31 x x x x x x x 28 3 203 334 88







 

Video On Demand (VOD)


Features Model Elements



Variant VOD SP SelectM StartM PI VRC P StopM QP CS D Cl Int Attr Op Rel



VOD_00 x x x x x x




32 0 280 217 79



VOD_01 x x x x x x x



32 0 280 217 79



VOD_02 x x x x x x
x


33 0 280 221 81



VOD_03 x x x x x x x x


33 0 280 221 81



VOD_04 x x x x x x

x

33 0 280 221 81



VOD_05 x x x x x x x
x

33 0 280 221 81



VOD_06 x x x x x x
x x

34 0 280 225 83



VOD_07 x x x x x x x x x

34 0 280 225 83



VOD_08 x x x x x x


x
37 0 280 232 92



VOD_09 x x x x x x x

x
37 0 280 232 92



VOD_10 x x x x x x
x
x
38 0 280 236 94



VOD_11 x x x x x x x x
x
38 0 280 236 94



VOD_12 x x x x x x

x x
38 0 280 236 94



VOD_13 x x x x x x x
x x
38 0 280 236 94



VOD_14 x x x x x x
x x x
39 0 280 240 96



VOD_15 x x x x x x x x x x
39 0 280 240 96



VOD_16 x x x x x x



x 35 0 280 226 87



VOD_17 x x x x x x x


x 35 0 280 226 87



VOD_18 x x x x x x
x

x 36 0 280 230 89



VOD_19 x x x x x x x x

x 36 0 280 230 89



VOD_20 x x x x x x

x
x 36 0 280 230 89



VOD_21 x x x x x x x
x
x 36 0 280 230 89



VOD_22 x x x x x x
x x
x 37 0 280 234 91



VOD_23 x x x x x x x x x
x 37 0 280 234 91



VOD_24 x x x x x x


x x 40 0 280 241 100



VOD_25 x x x x x x x

x x 40 0 280 241 100



VOD_26 x x x x x x
x
x x 41 0 280 245 102



VOD_27 x x x x x x x x
x x 41 0 280 245 102



VOD_28 x x x x x x

x x x 41 0 280 245 102



VOD_29 x x x x x x x
x x x 41 0 280 245 102



VOD_30 x x x x x x
x x x x 42 0 280 249 104



VOD_31 x x x x x x x x x x x 42 0 280 249 104



 

Download Case Studies of Scenario 2 - The case studies in this scenario are composed of variants with the combinations of at most half of the features. When some features of the case study were not present in any of the variants, then we selected one additional variant to have the implementation of that feature at least once.

 

Mobile Media - Version 2 (MMv2)


Features Model Elements








Variant MM IP 132x176 128x149 176x205 IS Cl Int Attr Op Rel








MMv2_P01 x x x


24 1 25 133 21








MMv2_P02 x x
x

24 1 25 133 21








MMv2_P03 x x

x
24 1 25 133 21








MMv2_P04 x x x

x 24 1 26 138 21








MMv2_P04 x x x

x 24 1 26 138 21








MMv2_P04 x x
x
x 24 1 26 138 21








MMv2_P04 x x

x x 24 1 26 138 21








 

Mobile Media - Version 3 (MMv3)


Features Model Elements







Variant MM IP 132x176 128x149 176x205 IF IS Cl Int Attr Op Rel







MMv3_P01 x x x



24 1 25 133 21







MMv3_P02 x x
x


24 1 25 133 21







MMv3_P03 x x

x

24 1 25 133 21







MMv3_P04 x x x

x
24 1 26 136 21







MMv3_P05 x x
x
x
24 1 26 136 21







MMv3_P06 x x

x x
24 1 26 136 21







MMv3_P07 x x x


x 24 1 26 138 21







MMv3_P08 x x
x

x 24 1 26 138 21







MMv3_P09 x x

x
x 24 1 26 138 21







MMv3_P10 x x x

x x 24 1 27 141 21







MMv3_P11 x x
x
x x 24 1 27 141 21







MMv3_P12 x x

x x x 24 1 27 141 21







 

Mobile Media - Version 4 (MMv4)


Features Model Elements






Variant MM IP 132x176 128x149 176x205 ICM IF IS Cl Int Attr Op Rel






MMv4_P01 x x x




28 1 25 147 25






MMv4_P02 x x
x



28 1 25 147 25






MMv4_P03 x x

x


28 1 25 147 25






MMv4_P04 x x x

x

29 1 26 151 28






MMv4_P05 x x
x
x

29 1 26 151 28






MMv4_P06 x x

x x

29 1 26 151 28






MMv4_P07 x x x


x
28 1 26 150 25






MMv4_P08 x x
x

x
28 1 26 150 25






MMv4_P09 x x

x
x
28 1 26 150 25






MMv4_P13 x x x



x 28 1 26 152 25






MMv4_P14 x x
x


x 28 1 26 152 25






MMv4_P15 x x

x

x 28 1 26 152 25






MMv4_P22 x x x

x x x 29 1 28 159 28






MMv4_P23 x x
x
x x x 29 1 28 159 28






MMv4_P24 x x

x x x x 29 1 28 159 28






 

Mobile Media - Version 5 (MMv5)


Features Model Elements





Variant MM IP 132x176 128x149 176x205 SMS ICM IF IS Cl Int Attr Op Rel





MMv5_P01 x x x





28 1 25 147 25





MMv5_P02 x x
x




28 1 25 147 25





MMv5_P03 x x

x



28 1 25 147 25





MMv5_P04 x x x

x


36 1 43 190 29





MMv5_P05 x x
x
x


36 1 43 190 29





MMv5_P06 x x

x x


36 1 43 190 29





MMv5_P07 x x x


x

29 1 26 154 28





MMv5_P08 x x
x

x

29 1 26 154 28





MMv5_P09 x x

x
x

29 1 26 154 28





MMv5_P10 x x x

x x

36 1 43 192 31





MMv5_P11 x x
x
x x

36 1 43 192 31





MMv5_P12 x x

x x x

36 1 43 192 31





MMv5_P13 x x x



x
28 1 26 150 25





MMv5_P14 x x
x


x
28 1 26 150 25





MMv5_P15 x x

x

x
28 1 26 150 25





MMv5_P16 x x x

x
x
36 1 44 193 29





MMv5_P17 x x
x
x
x
36 1 44 193 29





MMv5_P18 x x

x x
x
36 1 44 193 29





MMv5_P19 x x x


x x
29 1 27 157 28





MMv5_P20 x x
x

x x
29 1 27 157 28





MMv5_P21 x x

x
x x
29 1 27 157 28





MMv5_P25 x x x




x 28 1 26 152 25





MMv5_P26 x x
x



x 28 1 26 152 25





MMv5_P27 x x

x


x 28 1 26 152 25





MMv5_P28 x x x

x

x 36 1 44 195 29





MMv5_P29 x x
x
x

x 36 1 44 195 29





MMv5_P30 x x

x x

x 36 1 44 195 29





MMv5_P31 x x x


x
x 29 1 27 159 28





MMv5_P32 x x
x

x
x 29 1 27 159 28





MMv5_P33 x x

x
x
x 29 1 27 159 28





MMv5_P37 x x x



x x 28 1 27 155 25





MMv5_P38 x x
x


x x 28 1 27 155 25





MMv5_P39 x x

x

x x 28 1 27 155 25





MMv5_P46 x x x

x x x x 36 1 45 200 31





MMv5_P47 x x
x
x x x x 36 1 45 200 31





MMv5_P48 x x

x x x x x 36 1 45 200 31





 

Game Of Life (GOL)


Features Model Elements
Variant GB MB AG RDG RG FG FDG GS T IO PM URGB URG UR URT Cl Int Attr Op Rel
GOL_P00 x x












12 1 19 57 29
GOL_P01 x x x x x









14 2 19 69 31
GOL_P02 x x x

x x







14 2 21 69 31
GOL_P03 x x x x x x
x






16 2 21 73 33
GOL_P04 x x x
x x x x






16 2 21 73 33
GOL_P05 x x x x x


x





15 2 19 75 31
GOL_P06 x x x

x x
x





15 2 21 75 31
GOL_P07 x x x x x x
x x





17 2 21 79 33
GOL_P08 x x x
x x x x x





17 2 21 79 33
GOL_P09 x x x x x



x




15 2 24 72 31
GOL_P10 x x x

x x

x




15 2 26 72 31
GOL_P11 x x x x x x
x
x




17 2 26 76 33
GOL_P12 x x x
x x x x
x




17 2 26 76 33
GOL_P13 x x x x x


x x




16 2 24 78 31
GOL_P14 x x x

x x
x x




16 2 26 78 31
GOL_P17 x x x x x




x



15 2 21 70 33
GOL_P18 x x x

x x


x



15 2 23 70 33
GOL_P19 x x x x x x
x

x



17 2 23 74 35
GOL_P20 x x x
x x x x

x



17 2 23 74 35
GOL_P21 x x x x x


x
x



16 2 21 76 33
GOL_P22 x x x

x x
x
x



16 2 23 76 33
GOL_P25 x x x x x



x x



16 2 26 73 33
GOL_P26 x x x

x x

x x



16 2 28 73 33
GOL_P29 x x x x x


x x x



17 2 26 79 33
GOL_P30 x x x

x x
x x x



17 2 28 79 33
GOL_P33 x x x x x





x x x
14 2 19 79 32
GOL_P34 x x x

x x



x x x
14 2 21 79 32
GOL_P50 x x x

x x
x

x x x x 15 2 21 85 32
GOL_P63 x x x x x x
x x x x x x x x 19 2 28 93 36
GOL_P64 x x x
x x x x x x x x x x x 19 2 28 93 36