HAL Id: hal-01088464
https://hal.inria.fr/hal-01088464
Submitted on 30 Nov 2014
HAL is a multi-disciplinary open access archive for the deposit and dissemination of sci- entific research documents, whether they are pub- lished or not. The documents may come from teaching and research institutions in France or abroad, or from public or private research centers.
L’archive ouverte pluridisciplinaire HAL, est destinée au dépôt et à la diffusion de documents scientifiques de niveau recherche, publiés ou non, émanant des établissements d’enseignement et de recherche français ou étrangers, des laboratoires publics ou privés.
Specifications -The VCC Approach
Mauricio Alférez, Roberto Erick Lopez-Herrejon, Ana Moreira, Vasco Amaral, Alexander Egyed
To cite this version:
Mauricio Alférez, Roberto Erick Lopez-Herrejon, Ana Moreira, Vasco Amaral, Alexander Egyed. Con-
sistency Checking in Early Software Product Line Specifications -The VCC Approach. Journal of
Universal Computer Science, Graz University of Technology, Institut für Informationssysteme und
Computer Medien, 2014, 20 (5), pp.640 - 665. �hal-01088464�
Consistency Checking in Early Software Product Line Specifications - The VCC Approach
Mauricio Alférez
(CITI and Departamento de Informática, Faculdade de Ciências e Tecnologia Universidade Nova de Lisboa, Portugal &
INRIA, DiverSE Team, Rennes, France mauricio.alferez@{campus.fct.unl.pt, inria.fr})
Roberto E. Lopez-Herrejón
(Institute for Systems Engineering and Automation Johannes Kepler University, Linz, Austria
roberto.lopez@jku.at) Ana Moreira, Vasco Amaral
(CITI and Departamento de Informática, Faculdade de Ciências e Tecnologia Universidade Nova de Lisboa, Portugal
{amm,vasco.amaral}@fct.unl.pt) Alexander Egyed
(Institute for Systems Engineering and Automation Johannes Kepler University, Linz, Austria
alexander.egyed@jku.at)
Abstract: Software Product Line Engineering (SPLE) is a successful paradigm to pro- duce a family of products for a specific domain. A challenge in SPLE is to check that different models used in early SPL specification do not contain inconsistent information that may be propagated and generate inconsistent products that do not conform to its requirements. This challenge is difficult to address due to the high number of possible combinations of product features and model fragments specifying those features. Vari- ability Consistency Checking (VCC) offers automatic means to address that challenge.
VCC relates information inferred from the relationships between features and from base models related to those features. Validating if all the products in an SPL satisfy user-defined consistency constraints is based on searching for a satisfying assignment of each formula generated by VCC. We validated VCC and its supporting tool on two case studies from different application domains, the results were encouraging as we did not observed significant performance penalties.
Key Words: Model-Driven Development, Variability Modeling, Verification, Model- Based Software Product Lines, Requirements Engineering, Architecture Design, Fea- ture Modeling Analysis, Variability-Intensive Systems, Highly Configurable Systems.
Category: D.2.1, D.2.2, D.2.4, D.2.10, D.2.11, D.2.13, F.3.1, F.4.1, I.6.4, I.6.5
1 Introduction
A Software Product Line (SPL) is “a set of software–intensive systems sharing a common, managed set of features that satisfy the specific needs of a particular market segment or mission and that are developed from a common set of core as- sets in a prescribed way” [Clements and Northrop, 2002]. An SPL is described in terms of features, defined as increments in system’s functionality. Every concrete system in an SPL is seen as a product variant (or product) that is identified by a unique combination of features. Traditionally, a feature model is used to represent features and their interdependencies. Each product is then assembled from a set of common features and a selection of optional features from the feature model, what is called feature model configuration [Czarnecki and Eisenecker, 2000].
The meaning of the features contained in a feature model are usually de- scribed using other complimentary models, supporting the developers’ focus on different processes of the SPL, such as requirements, architecture, and detailed design. However, the need for these multiple models to coexist demand for con- sistency among them.
In general, a system is consistent when there is logical coherence (i.e., no contradictions) between its parts. Algorithms that verify the satisfaction of con- sistency conditions in a system can measure consistency. These conditions can be as diverse as architectural and design guidelines, programming conventions and well-formedness rules. In the context of this paper, consistency checking refers to the verification of consistency constraints (or conditions) between a feature model and other early base models (i.e., requirements and high-level architecture models) used to describe those features.
In an inconsistent SPL, valid base models may be invalid in terms of the feature model and invalid base models may be valid in terms of the feature model. According to [Apel et al., 2010b], the latter case is especially difficult to address because it is usually detected only after generating specific product vari- ants based on a selection of features. Due to the possible very large number of different valid features combinations and their relationships with model frag- ments, consistency checking for every product variant is feasible only for small SPLs [Apel et al., 2010b].
The goal of this paper is to present the Variability Consistency Checker approach (VCC) that addresses consistency checking during domain engineering for early SPL specifications, not for only a single, small product at a time.
Checking if all the products in an SPL satisfy consistency constraints is based on searching for a satisfying assignment for each propositional formula generated by VCC.
Each propositional formula varies according to the type of consistency con-
straint and the relationships between: (1) feature expressions (i.e., combinations
of features and logical operators) obtained from the feature model, and (2) de-
pendencies and incompatibilities between fragments of the base models related to feature expressions. The VCC tool translates propositional formulas that are evaluated by satisfiability (SAT) solvers 1 . For consistency constraints that are not satisfied by the SPL, the VCC tool presents to the developer the features and fragments in the base models involved in the violation of the constraint.
Such output is useful to take informed decisions to improve the feature model and its associated base models.
Our aim of checking consistency for an entire SPL instead of only for a single product is in line with a new generation of ap- proaches [Kästner and Apel, 2008, Apel et al., 2010a, Delaware et al., 2009, Thaker et al., 2007, Czarnecki and Pietroszek, 2006]. The goal of those approaches is to guarantee that every valid feature selection produces a type- correct program (see Section 6–Discussion and Related Work). VCC, however, focuses on proactively checking consistency on base models. Therefore, it helps developers to complete the models through repeated cycles (iterations) and in small portions at a time (incrementally). Also, VCC considers that relationships among base models fragments can suggest constraints that should be reflected in the feature model. That characteristic is especially useful during reactive SPL development where different people create base models before the feature model.
We recognize that not all technical possible configurations of base models should be reflected in the feature model. Nevertheless, given that the knowledge expressed by domain experts in requirements and high-level architectural models is not too technical (in comparison with what is required for code), both feature model and base models used in early SPLE should be consistent (or at least, to have a tolerable small number of potential inconsistencies that can only be solved later in the development process).
The results of applying VCC to two case studies from different application domains are encouraging, given that no significant performance penalties were observed when automatically verifying a set of user-defined consistency rules.
The remaining of this paper is structured as follows. Section 2 motivates consistency checking with an example brought from part of a home automation SPL called Smart Home. Section 3 presents the VCC approach followed by a description of its tool support in Section 4. Section 5 shows the validation of VCC based on the full Smart Home and an SPL for photos manipulation in mobile devices called Mobile Photo. Section 6 discusses and relates our work with other works. Finally, Section 7 presents our concluding remarks and future work.
1 The SAT problem is to check whether a formula is satisfiable. For example, the
formula "a And Not b" is satisfiable because one can find the values a = True
and b = False, which make (a And Not b) = True. In contrast, "a And Not a" is
unsatisfiable. See details in http://www.satisfiability.org
2 Motivational Example
This section presents an example that illustrates inconsistency based on four kinds of models used during early SPL development: (1) feature model, (2) base models 2 , (3) composition specification model, which determines how each selec- tion of features triggers transformations of the base models, and (4) mapping model between features and base models.
The example used in this section to illustrate VCC is taken from one of the two case studies used in the European AMPLE project (http://www.
ample-project.net). The two case studies briefly discussed in the validation section (Section 5) are Smart Home and Mobile Photo. For the Smart Home, we have chosen use cases and activity diagrams to model the requirements of the system. For the Mobile Photo, we started from a top-down analysis of ar- chitectural components. Hence, in this paper we focus on those three types of base models. However, other models (e.g. class diagrams) could be used as base models in VCC.
2.1 Creating a Feature Model and Base Models
Figure 1 (a) shows part of a feature model for one of our case studies, the Smart Home SPL [Morganho and Gomes, 2008]. Smart Home has four optional features, Automated Windows, Automated Heating, Remote Heating Ctrl and Internet to control the heater and other devices remotely. Also, it has a set of common features, such as Manual Windows, Manual Heating and In-home Screen that will be included in all the target products produced from the Smart Home SPL.
Each feature model configuration corresponds to a product variant and is defined by selecting optional features in the feature model. Figure 1 (b) shows Product-1, which has all the features, and Figure 1 (c) shows Product-2, which has all features except Automated Windows. Domain constraints such as the Requires relationship from Remote Heating Ctrl to Internet, can be added in- crementally when creating base models (discussed below).
Use cases and activity diagrams provide a description of what products in the domain should do. Feature models determine which functionality can be selected when engineering new products from the SPL. Therefore, product requirements specifications consist of customized use cases and activity diagrams. The cus- tomization is guided by a composition specification discussed in Section 2.2.
For space reasons we do not show separately all the available model frag- ments before composition; instead, we show the resulting models for one sample
2 Section 5 shows constraints for use case, activity and components di-
agrams that can be found online at http://people.rennes.inria.fr/Edward-
Mauricio.Alferez_Salinas/JUCS/data.htm
Windows Ctrl Automated
Windows
Heating Ctrl SmartHome
Manual Windows
(a) SPL Feature Model
Manual Heating Automated
Heating Remote Heating Ctrl
UI Internet Inhome Screen
Optional feature
Mandatory feature when all its ancestors are selected
Selected feature Unselected feature
(b) Product-1
(c) Product-2
Domain constraint “requires”
Windows Ctrl Automated
Windows
Heating Ctrl Product-1
Manual
Windows Manual
Heating Automated Heating Remote Heating Ctrl
UI Internet Inhome Screen
Windows Ctrl Automated
Windows
Heating Ctrl Product-2
Manual
Windows Manual
Heating Automated Heating Remote Heating Ctrl
UI Internet Inhome Screen
Figure 1: (a) Simplified sample of the Smart Home feature model; (b) Sample config- uration that includes all features; (c) Sample configuration that excludes Automated Windows.
product. Figure 2 (a) (left- and right-hand sides) shows two of the models that are part of the base models for Product-1. The left-hand side shows an activity diagram that depicts the possible scenarios for the use case Ctrl Temp Remotely that is described in the use case diagram on the right-hand side of Figure 2 (a).
The activity diagram also contains activities of use cases Open And Close Win Auto, Adjust Heater Value and Notify By Internet. Within this activity diagram it is possible to select several scenarios that correspond to different paths. Two of these scenarios are: Scenario (S1) includes reaching the in-home temperature and save energy by means of closing some windows, and Scenario (S2) uses the heater to reach the desired in-home temperature.
Figure 2 (a) (right-hand side) shows part of the use case model composed for Product-1. The Includes relationship supports the reuse of functionality in a use case diagram and is used to express that the behavior of the inclusion use case is common to other use cases. Note that Includes relationships between use cases may constrain the relationship between the features related to them.
For example, the Includes relationship between the base use case Ctrl Temp Remotely that includes the use case Open And Close Win Auto may imply that feature Remote Heating Ctrl requires the feature Automated Windows.
Customization of base models such as activity diagrams and scenarios de-
pends on the features chosen and on their relationships with the use case dia-
gram. For example, given that in Product-2 the feature Automated Windows was
not selected, the Win Actuator actor in the use case diagram as well as the activ-
ity partition (or swim-lane) related to Windows Actuator will not appear in any
diagram. Therefore, scenarios such as Scenario S1, are not realizable due to lack
of window actuators. This and other constraints will be discussed in Section 3.
Related to “Automated Windows”
Related to “And (“Remote Heating Ctrl” , “Automated Heating” , “Internet”)”
Related to other features expressions.
Heating Adjust HeaterValue
CtrlTemp Remotely
<<actor>>
Thermostat
<<actor>>
Heater
<<include>>
OpenAnd CloseWin
OpenAndClose WinAuto
<<actor>>
WinSensor
<<actor>>
WinActuator
<<include>>
OpenAnd CloseWin Manual Inhabitant
Notification
Notify
NotifyInhomeScreen
<<include>>
<<include>>
(a) UseScenario:SampleCustomized ModelͲBased Specifications forProductͲ1:
(LeftͲhand side)SampleActivity Diagram “CtrlTempRemotelly”Related to(RightͲhand side)UseCaseDiagram
Related Model Elements in Activity Diagram Use Case NotifyByInternet
<<extend>>
SmartHome
Inhabitatnt Sends Desired Temp By Internet
CloseWindows MonitorTemperature
AdjustHeaterValue OpenWindows [OutOfTDesiredValue]
[OpenWindows]
[UseHeater]
[CloseWindows]
DetermineLowEnergy ConsumptionStrategy
WinActuatorInhabitantSmartHome
NotifyChangeByInternet
Heater
...more activity diagrams
…
(b)MappingBetweenFeatureExpresionsandModelElements WinMan
Not human actor.
(c)Notation Used inUseCaseand Activity Diagrams
<<actor>>
Name
Human actor.
Name
<<include>>
Include relationship
Extend relationship
Asociation relationship
name
Partition
name
<<extend>>
Name
Package
name Use case
Generalization relationship Action
[guard]
Activity edge
Initial node
Decision node
Figure 2: (a) Sample customized base models for Product-1 (i.e., the resulting models after composition); (b) Mapping between feature expressions and model fragments; (c) Notation used in use case and activity diagrams in (a).
2.2 Creating Composition and Mapping Models
A way to produce specific product models is through a composition. We show composition specifications of base models to illustrate the results of inconsis- tencies when deriving product variants and also as an artifact that is use- ful to map features to base models. We use VML4RE [Zschaler et al., 2009, Alférez et al., 2009] as an example of a composition specification language be- cause it allows referencing model elements easily and is very expressive.
Figure 3 illustrates part of the composition specification for the Smart Home.
In VML4RE, actions, that wrap a set of model transformations, are related to combinations of features called feature expression and written as a logic expres- sion. Feature expressions can be Atomic, representing single features (Line 1 of Figure 3) or Compound, containing logic operators such as And, Not and Or (Line 7).
Feature expressions evaluation works as follows: if in a feature model con-
figuration, a feature is selected to be part of a product, that feature evaluates
to True and if the feature is not selected it evaluates to False. Thus, a feature
expression can be evaluated to True or False taking into account the Boolean
value of each feature in the feature expression. If a feature expression evaluates
to True, its corresponding actions will be processed and applied to another model
(or base model). Otherwise, if the feature expression evaluates to False, the next
1. Variant { name : "A-W" for : "Automated Windows"
2. + UseCase : "OpenAndCloseWinAuto" in Package : "WinMan"
3. + Partition : "WinActuator" in ActDiagram :“CtrlTempAuto"
4. ...
5. }
6. Variant { name : "R-H"
7. for : And ("Remote Heating Ctrl","Automated Heating","Internet") 8. + UseCase : "CtrlTempRemotely" in Package : "Heating"
9. + UseCase : "CalcEnergyConsumption" in Package : "Heating"
10. Includes from UseCase : "CtrlTempRemotely" to UseCase(s) :
11. "NotifyByInternet" and "OpenAndCloseWinAuto" and "AdjustHeaterValue"
12. ...
13. }
...more variants
Figure 3: Composition specification of variants blocks A-W and R-H
feature expressions will be read and evaluated until the end of the composition specification.
In our example, if Automated Heating, Remote Heating Ctrl and Internet features are selected in a product configuration, the feature expression associated to the variant block named R-H (i.e., the compound feature expression: And ("Remote Heating Ctrl","Automated Heating","Internet")) will be evaluated to True. The consequence is that the actions inside the R-H variant block (Figure 3, Lines 6-13) will be processed and applied to a base model. For example, the Ctrl Temp Remotely use case will be inserted into the package Heating and then it will be related to other use cases using Includes and Extends relationships. For simplicity, we omitted some of the actions, such as the insertion of actors Win Sensor and Win Actuator, and some activity partitions, such as Heater.
Figure 2 (a) shows model fragments, such as actors and use cases, related to
the feature expressions shown in Figure 3. Figure 2 keeps composition models
and mapping model separated, as they result from different processes. Nonethe-
less, it is possible to parse the composition specification to generate the mapping
between feature expressions and base models. Therefore, for example, we relate
the feature expression of A-W, Automated Windows, to Open And Close Win
Auto. To facilitate the visualization of such relationships, we assign different
gray tones to the model fragments according to the feature expressions they are
related to (see mapping in Figure 2 (b)). Also, note that specific model frag-
ments could be related to more than one variant block; this may be considered
as a M-to-N (with M, N >= 1) mapping between variant blocks (and its feature
expressions) and model fragments (not illustrated in Figure 2).
2.3 Consistency Checking Motivation
Consistency checking aims at ensuring that requirements and constraints related to a feature model and base models are consistent between them. We analyze two requirements in the Smart Home example. Requirement-1, which is inferred from the feature model and the feature expressions in the mapping model, and Requirement-2 which is inferred from the base models:
– Requirement-1: Only one, none or both R-H and A-W can be included in a product. This information is inferred from the feature model and mapping model because all the features in the feature expression of the R-H variant block are optional and not exclusive between them (i.e., Remote Heating Ctrl, Automated Heating and Internet are optional features), and the only feature in the feature expression of the variant block A-W is also optional (i.e., the Automated Windows feature is optional).
– Requirement-2: If the use case Ctrl Temp Remotely is provided in a product, then the use case Open And Close Win Auto and its related steps in the activity diagram must be provided too in order to support all the intended use scenarios. This is implicit on the Includes relationship from the use case Ctrl Temp Remotely to Open And Close Win Auto in the use case diagram in Figure 2 (a) (right-hand side), and also because of the control flow between Determine Low Energy Consumption Strategy and Open Windows / Close Windows in Figure 2 (a) (left-hand side).
In the particular case of the Smart Home use scenarios, an inconsistency can be detected: there is at least one product that cannot satisfy Requirement-1 and Requirement-2. Let’s analyze how both requirements are satisfied (or not) in each product.
While Requirement-1 is satisfied by all the product configurations, therefore satisfied by Product-1 and Product-2 (since they have the same feature model and mapping models), Requirement-2 is satisfied by Product-1 only as its use cases and activities supported all the required use scenarios for this product.
For example, given that the base use case Ctrl Temp Remotely was provided in Product-1, the use cases related to it through an Includes relationship, for example Open And Close Win Auto, are also present in the model. The Includes relationship supports the reuse of functionality in use case diagrams in which one use case (the base use case) requires the functionality of another use case (the inclusion use case). Therefore, all possible use scenarios related to Ctrl Temp Remotely are supported only when its inclusion use cases are included.
Requirement-2 is not satisfied by Product-2 because its feature configura- tion (shown in Figure 1 (c)) does not include the Automated Windows feature.
Therefore, the feature expression of variant block A-W (Figure 3, Line 1) eval-
uates to False and the actions inside its variant block are not processed, for
example, the inclusion of the use case Open And Close Win Auto. The result is that the functionality provided by Open And Close Win Auto will not be present in the requirements of Product-2 and therefore it will not be taken into account in later stages of its development process, thus given no support for the scenarios related to Ctrl Temp Remotely.
One solution to solve the inconsistency for our example is to guarantee the presence of the feature Automated Windows when Automatic Heating or Remote Heating Ctrl are selected, in every possible feature model configurations. This can be achieved by creating feature model constraints such as "Requires" (i.e., the selection of one feature requires the selection of another feature) from Remote Heating Ctrl to Automated Windows or to establish that Automated Windows is a mandatory feature. However, as the number of possible feature combinations may grow exponentially with the number of features of an SPL, it is unfeasible to manually check the consistency of all products, one by one. The following section discusses VCC, our solution for consistency checking during domain engineering.
3 The VCC Approach
This section explains the automation of VCC, through the functions Vcc and Main shown in Algorithm 1. The creation of the models to be analyzed (Lines 1-4) was exemplified in Section 2. Main is composed of a loop (Lines 16-24) where new iterations take place if the report generated by function Vcc (Line 15) shows the existence of inconsistencies (Line 16), or the developer decides to modify the input models after reported inconsistencies (Lines 18-19).
In VCC, Feature Model Constraints (FC ) and Base Models Constraints (BC ) must be consistent among them. FC (Line 8) is obtained from the feature model (addressed in Section 3.1) and BC (Line 9) is obtained from the relationships between model elements in the base models (addressed in Section 3.2).
We employ propositional logic to express and relate FC and BC. Our goal
is to guarantee that FC meets BC (i.e., BC → FC ) and that BC meets FC
(i.e., FC → BC ). To check consistency (Line 10), Equation 1 should not be
satisfiable for each and every consistency rule instance that we want to check. If
it is satisfied, it means that feature model constraints do not meet base models
constraints (i.e., ¬(BC →FC ) is satisfiable), or that the base models constraints
do not meet feature model constraints (i.e., ¬ (FC → BC)) is satisfiable).
Algorithm 1. Overview of the VCC Approach 1 input: B = Base Models 14 Main (B, F, C, M) { 2 F = Feature Model 15 R ← Vcc (B, F, C, M)
3 C = Composition Model 16 while (not R.splConsistent ()){
4 M = Mapping Model 17 R.showInconsistencies () 5 output: R = Report 18 if (developerAnswer equals
6 19 “I want more iterations”)
7 Report Vcc (B, F, C, M){ 20 /* developers modifies one or
8 FC ← Obtain FC (F) 21 more of the input models */
9 BC ← Obtain BC (B, C, M) 22 R ← Vcc (B ’, F ’, C ’, M ’) 10 R ← Check (FC , BC) 23 else exit
11 return R 24 }
12 } 25 print (“SPL Consistent”)
13 26 }
¬ ( BC → F C )
¬ ( F C → BC ) (1)
Section 3.3 explains how VCC and a SAT solver can identify the inconsistent features and the model fragments (Line 13). This information helps the user making informed decisions to modify the initial models (in Line 20, the symbol ’ indicates a modified version of the model).
Section 2 showed that at least one product (i.e., Product-2) from the Smart Home SPL is inconsistent. In that case, constraints that can be inferred from use scenarios, such as the "Includes" between use cases and related control flows, and actions in activity diagrams, imply the application of feature model con- straints (i.e., BC →FC ). In our example, the particular consistency condition that guarantees that ¬(BC →FC ) is not satisfiable, is defined by the rule:
– Required Inclusion Use Case: at least one variant block defining an inclu- sion use case must be selected in every feature configuration containing the variant block that introduces a base use case linked to the inclusion use case.
The following subsections discuss the VCC approach in details. In particular, they explain how to derive FC (Section 3.1) and BC (Section 3.2), as well as how the Check function uses FC and BC to generate a report (Section 3.3).
3.1 Obtaining Constraints between Features ( F C )
To express FC it is necessary to translate the feature model to some type of logic.
That idea was first proposed by [Mannion, 2002] and [Batory, 2005]. The results
of their work are summarized in Table 1, where a mapping between feature model
elements and propositional logic is presented. The next three steps summarize
the process:
1. Each feature maps to a variable of the propositional formula;
2. Each relationship (e.g., requires, optional) is mapped onto one or more for- mulas;
3. The resulting formula is the conjunction of all the resulting formulas of Step 2, plus an additional constraint assigning True to the variable that represents the root feature (e.g., SmartHome↔True).
Mandatory Requires Or
Optional Excludes XOr
f
1f
21
2
f
f →
(
n)
p
f f f
f ↔
1∨
2∨ ... ∨ f
nf
pf
1f
2( )
( )
( )
( )
( )
(
n n p)
p n
p n
f f f f f
f f f f
f f f f
∧
¬
∧
∧
¬
∧
¬
↔
∧
∧
¬
∧
∧
¬
↔
∧
∧
¬
∧
∧
¬
↔
−1 2 1 1 2
2 1
...
...
...
( f
a∧ f
b)
¬
b
a f
f →
f
bf
af
bf
af
pf
1f 2
f
nf
1f
22
1
f
f ↔
Table 1: Mapping from feature model to propositional logic (based on [Benavides et al., 2010])
Equation 2 shows an example for the Heating Ctrl branch, the most complex branch in Figure 1 (a), and relates directly with the example "Required Inclu- sion Use Case" rule. The translation obtained in the first line of Equation 2 means that all products unconditionally must contain the root feature Smart Home. Line 2 means that Heating Ctrl must be included in all the products, since it is a mandatory feature. Line 3 means that Manual Heating is included in all the products that include their parent feature (i.e., Heating Ctrl), in con- trast to Automated Heating and Remote Heating Ctrl (Lines 3-4) that may, or may not, be included when their respective parents Heating Ctrl and Automated Heating are included in a product. Line 5 means that Remote Heating Ctrl re- quires the Internet feature.
1 . ( SmartHome ↔ T rue ) ∧ 2. (SmartHome ↔ HeatingCtrl) ∧ 3. (HeatingCtrl ↔ M anualHeating) ∧
(AutomatedHeating → HeatingCtrl) ∧ 4 . ( RemoteHeatingCtrl → AutomatedHeating ) ∧ 5 . ( RemoteHeatingCtrl → Internet )
(2)
3.2 Obtaining Base Models Constraints ( BC )
To derive BC it is necessary to analyze the relationships among model elements in base models. This section explains how to obtain such relationships and how to express them in terms of feature expressions (propositional logic).
3.2.1 Obtaining Relationships between Model Elements
There are two non-mutually exclusive ways to obtain relationships between model elements:
1. Based on the actions of the composition specification. All the actions that suggest the pre-existence of model elements are good candidates to be ana- lyzed. This is the case presented in Figure 4 (b), where the use case Ctrl Temp Remotely includes the behavior represented by Open And Close Win Auto.
Therefore, one may create a requirer-required relationship among model ele- ments. The requirer is Ctrl Temp Remotely and the required model element is Open And Close Win Auto. (More types of relationships are shown in the Validation, Section 5.)
Figure 4 shows an example of the relationships between model elements and their metaclasses based on a line of a composition specification written using VML4RE (Figure 4 (c)). ConnectByIncludes, in Figure 4 (a), is a metaclass in VML4RE that represents the action (Figure 4 (c)) that links a use case to one or more use cases using the Include relationship, as is shown in Figure 4 (b). ConnectByIncludes is one of the actions that specializes the action Connect, and UseCase is a type of ModelElement referenced by ConnectByIncludes.
2. Based on the base models. This is probably the best way to obtain rela- tionships when there is explicit information about the elements provided, required or incompatible. This is the case for UML component diagrams where each component usually declares explicitly a list of provided and re- quired interfaces. It is straightforward to parse a base model and to create a list of relationships.
3.2.2 Expressing BC
Base models’ constraints (BC) act as consistency rules describing the relation-
ships that must hold among different model elements. There are two basic types
of BC that we classify according to the type of feature model constraint that they
relate with: (1) constraints that imply an Excludes relationship between features,
and (2) constraints that imply a Requires relationship between features.