We will illustrate the steps of our approach
through the example of an SPL for mobile phones.
This SPL example is a software product family with
nine product variants Our approach takes as input the
source code of a set of these product variants. Each
product implements a simple mobile application.
3.1 Name Harmonization
The product variants must be first harmonized to be-
come suitable as input to the LSI (in step 2). This pre-
processing starts by identifying the semantic corre-
spondences between the names of packages, classes,
methods and attributes names. The semantic relations
are examined in the following order: the equivalence
(Synonyms), the string extension (Meronyms), and
then the generlization (Hypernyms).
All element names identified as equivalent are har-
monized by keeping one version of them across all
the product variants. In our mobile phone, in the class
”AddPhotoToAlbum”, we found ”GetPhotoName()”
and ”SetPhotoName()”; these two methods are equiv-
alent. A second example is the methods ”GetItem-
Name()” and ”SetItemName()” are also equivalent.
A third example is the equivalence between the at-
tributes ”image” and ”photo”. For each pair of equiv-
alent names, one of them is chosen to replace all other
occurrences of the name.
After the equivalent names are harmonized, the
pre-processing step considers the semantic relation-
ship ”Meronyms(C1; C2)” to replace the occurrences
of C2 by C1 which, being an extension of C2, is more
informative. In our example, we found ”Image” and
”ImageName”. At this stage, ”ImageName” will re-
place all occurrences of ”Image” in all product vari-
ants.
Finally, in general and especially with JAVA, the
class and its constructor has the same name. In
this case, we ignore one of them to save time. For
example, in the class AlbumListScreen, we found
methods having the same name AlbumListScreen(),
AlbumListScreen(String args0, int arg1), Album-
ListScreen(String args0, int arg1, String[] args2, Im-
age[] arg3).
At the end of the pre-processing step, all seman-
tically related names would be harmonized and can
then be analyzed through the FCA in the features
identification step.
3.2 Features Identification Step
In this step, we use FCA and LSI to extract the com-
monalities and variabilities among the harmonized
product variants. Before explaining this step, let us
first overview the basics of FCA and LSI.
Formal concept analysis (FCA) (Ganter and Wille,
1996) is a method of data analysis with a growing
popularity across various domains. As illustrated in
Figure 2, the main idea of FCA is to analyze data de-
scribed through the relationships among a particular
set of data elements (the table in Figure 2). In our ap-
proach, the data represent the product variants being
analyzed; the data description is represented through
a table where the product variants constitute the rows
while source code elements (packages, classes, meth-
ods, attributes) constitute the columns of the table.
Due to space limitations, Figure 4 shows an extract
of this table.
From the table, a concept lattice is derived. The
concept lattice permits, in the first time, to define
commonalities and variations among all products.
(The last part of Figure 2). The top element of the
lattice indicates that certain objects have elements in
common (i.e., common elements), while the bottom
element of the lattice shows that certain attributes fit
to common objects (variations). The elements are
grouped in blocks. First, common elements are com-
mon block which are commonly used in all products.
Secondly, the blocks of variations only appear in spe-
cific products. Common blocks and block variations
are composed of atomic blocks of variation represent-
ing only one feature.
Figure 2: Basics of the FCA analysis process.
In our running example, the common block con-
tains all the source code elements that appear in every
product. The source code elements that are shared by
more than one product are a block of variations. Ex-
ample,”Package:screen”, ”Class: AlbumListScreeb”,
”Class: PhotoViewScreen” presents the common
block. Others, like ”Class:AddListToAlbum”,
”Method:SelectionTypeOfMedia” are blocks of vari-
ation.
Besides the blocks, the lattice also indicates the re-
lationships among elements. The following relation-
ships can be automatically derived from the sparse
representation of the lattice and presented to the an-
alyst:
• Mandatory: features appearing at the top concept
in the lattice are used in every product.
ICSOFT2013-8thInternationalJointConferenceonSoftwareTechnologies
158