Flexible feature binding with AspectJ-based idioms
In Software Product Lines (SPL), we can bind reusable features to compose a product at different times, which in general are static or dynamic. The former allows customizability without any overhead at runtime. On the other hand, the latter allows feature activation or deactivation while running the application with the cost of performance and memory consumption. To implement features, we might use aspect-oriented programming (AOP), in which aspects enable a clear separation between base code and variable code. In this context, recent work provides
AspectJ-based idioms to implement flexible feature binding. However, we identified some design deficiencies. Thus, to solve the issues of these idioms, we incrementally create three new
AspectJ-based idioms. Moreover, to evaluate our new idioms, we quantitatively analyze them with respect to code cloning, scattering, tangling, and size by means of software metrics. Besides that, we qualitatively discuss our new idioms in terms of code reusability, changeability, instrumentation overhead, and behavior.
Procedures
First, to create the product lines from the original code of these case studies, we assigned the code of their features by using the prune dependency rules, which state that "a program element is relevant to a feature if it should be removed, or otherwise altered, when the feature is pruned from the application". By following these rules, we could identify all the code related to the features. We choose this rule to reduce introducing bias while identifying feature code.
Second, we extracted part of this code into
AspectJ aspects. We say part because some feature code do not need to be extracted into aspects. The code within some classes is not extracted into aspects because the whole class is only relevant to the feature, so it should not exist in the base code by following the prune dependency rules. Additionally, there are references to the elements of these classes only within the feature code. Each feature code is localized in a different and unique package, which contains aspects and, possibly, classes.
Third, to evaluate our three new idioms and Layered Aspects, we applied each one of our three new idioms plus Layered Aspects to implement flexible binding for the 16 features of the five case studies.
Fourth, we collect the number of lines of code (LOC) of relevant components, such as feature or driver code, to provide as input to compute the metrics. We use the Google
CodePro AnalytiX to obtain the LOC and we use sheets to auxiliary the computation of the metrics.
Tools and source code necessary to replicate our study
Here, we provide all the tools and source code necessary to replicate our study.
Source code - Git repositories
101Companies SPL
This is the 101Companies SPL project with Total and Cut features implemented with aspects.
101Companies SPL with Layered Aspects
This is the 101Companies SPL with flexible binding applied to Total and Cut features by means of Layered Aspects
101Companies SPL with First increment
This is the 101Companies SPL with flexible binding applied to Total and Cut features by means of First increment
101Companies SPL with Second increment
This is the 101Companies SPL with flexible binding applied to Total and Cut features by means of Second increment
101Companies SPL with AroundClosure
This is the 101Companies SPL with flexible binding applied to Total and Cut features by means of
AroundClosure
BerkeleyDB SPL
This is the
BerkeleyDB SPL project with its nine features implemented with aspects.
BerkeleyDB SPL with Layered Aspects
This is the
BerkeleyDB SPL with flexible binding applied to its nine features by means of Layered Aspects
BerkeleyDB SPL with First increment
This is the
BerkeleyDB SPL with flexible binding applied to its nine features by means of First increment
BerkeleyDB SPL with Second increment
This is the
BerkeleyDB SPL with flexible binding applied to its nine features by means of Second increment
BerkeleyDB SPL with AroundClosure
Freemind SPL
This is the Freemind SPL project with its two features implemented with aspects.
Freemind SPL with Layered Aspects
This is the Freemind SPL with flexible binding applied to its two features by means of Layered Aspects
Freemind SPL with First increment
This is the Freemind SPL with flexible binding applied to its two features by means of First increment
Freemind SPL with Second increment
This is the Freemind SPL with flexible binding applied to its two features by means of Second increment
Freemind SPL with AroundClosure
This is the Freemind SPL with flexible binding applied to its two features by means of
AroundClosure
In order to run the
ArgoUML, these three projects must be included in the workspace:
tools,
model, and
infra.
ArgoUML SPL
This is the
ArgoUML SPL project with its feature implemented with aspects.
ArgoUML SPL with Layered Aspects
This is the Freemind SPL with flexible binding applied to its feature by means of Layered Aspects
ArgoUML SPL with First increment
This is the Freemind SPL with flexible binding applied to its two features by means of First increment
ArgoUML SPL with Second increment
This is the Freemind SPL with flexible binding applied to its two features by means of Second increment
ArgoUML SPL with AroundClosure
This is the Freemind SPL with flexible binding applied to its two features by means of
AroundClosure
Sudoku with Layered Aspects
This is the Sudoku with flexible binding applied to its feature by means of Layered Aspects
Sudoku with Layered Aspects
Sudoku with First increment
This is the Sudoku with flexible binding applied to its feature by means of First increment
Sudoku with First increment
Sudoku with Second increment
TThis is the Sudoku with flexible binding applied to its feature by means of Second increment
Sudoku with Second increment
Sudoku with AroundClosure
This is the Sudoku with flexible binding applied to its feature by means of
AroundClosure
Sudoku with AroundClosure
In the following links, we provide extra source code we used to test and develop our idioms. This consists of a simple project with the quote feature, which adds a quote to a string.
Toyexample SPL with Layered Aspects
This is the Toyexample SPL with flexible binding applied to quote feature by means of Layered Aspects
Toyexample SPL with Layered Aspects
Toyexample SPL with First increment
This is the Toyexample SPL with flexible binding applied to quote feature by means of First increment
Toyexample SPL with First increment
Toyexample SPL with Second increment
This is the Toyexample SPL with flexible binding applied to quote feature by means of Second increment
Toyexample SPL with Second increment
Toyexample SPL with AroundClosure
This is the Toyexample SPL with flexible binding applied to quote feature by means of
AroundClosure
Toyexample SPL with AroundClosure
Sheets
In both sheets, we provide the formula of all the selected metrics. Additionally, they contain all the data we collected from the source code.
First Sheet
Second Sheet
Third Sheet
Tools
The following list contains the tools we used to perform our work:
Members
CIn-UFPE
IC-UFAL