A Propositional Logic-Based Method For Verification of Feature Models
A Propositional Logic-Based Method For Verification of Feature Models
net/publication/220744172
CITATIONS READS
131 652
3 authors:
Hong Mei
Xi'an Jiaotong University
314 PUBLICATIONS 8,015 CITATIONS
SEE PROFILE
All content following this page was uploaded by Wei Zhang on 09 October 2014.
Institute of Software,
School of Electronics Engineering and Computer Science,
Peking University, Beijing, 100871, China
{zhangw, zhhy}@sei.pku.edu.cn, [email protected]
1 Introduction
One practical approach to software reuse is to produce general purpose (i.e., reusable)
software artifacts, followed by customization to accommodate different situations. To
facilitate the customization of reusable software artifacts, elements in these artifacts
should be cohesive enough, and dependencies between elements should be specified
clearly.
Feature-oriented methods [1,2,3,4] have been proposed to improve the
customization of the problem space of software. These methods treat features as the
basic elements in the problem space, and use features, relationships (i.e. refinements
and constraints) between features (called feature model) to structure the problem
space. In the development for reuse phase [5, 9], a domain feature model is first
constructed by exploring commonality and variability in a software domain. Then, in
the later development with reuse phase, the domain feature model is customized into
application feature models according to different reuse contexts. Those still undecided
features in application feature models will be gradually bound or removed through a
series of binding times (e.g. compile-time, install-time, load-time, and run-time).
J. Davies et al. (Eds.): ICFEM 2004, LNCS 3308, pp. 115–130, 2004.
c Springer-Verlag Berlin Heidelberg 2004
116 W. Zhang, H. Zhao, and H. Mei
Constraints specified in the domain feature model then provide criteria to verify the
completeness and consistency of those customized feature models. In such a way,
customization of the domain feature model is operated.
However, as far as we know, all these feature-oriented methods lack effective
measures to verify partially customized feature models. A real customization process
often includes a series of binding times, in each of which, certain customizing
resolutions are decided and a partially customized feature model is obtained. The
inability to verify partially customized feature models increases the difficulty of
customization. As feature models become larger and constraints on features become
more complex, the cost of constraints modeling and maintenance will also increase
considerably. In addition, constraints defined by these methods currently are too
simple to describe complex constraints involving three or more features.
In this paper, we propose a propositional logic-based method for the verification
of feature models at different binding times. In this method, the statement “a feature is
in the bound state” is regard as a two-value proposition in the logic. These
propositions can further be combined with basic logical connectives to represent
complex constraints on features. By this way, constraints in a feature model are
formalized by a set of logical sentences. Then, at each binding time, after an
undecided feature is bound or removed, the truth value of this feature will become the
logical constant True or False respectively. Thus, the verification of feature models is
converted into satisfaction problems in the logic. Therefore, verification problems
such as the detection of inconsistent constraints or the detection of conflicting or
unnecessary binding resolutions can be automatically revealed.
The rest of this paper is organized as follows. Basic knowledge about feature
models is given in Section 2. Section 3 presents a propositional logic based
verification method in detail. Two case studies are illustrated in Section 4. Related
work is discussed in Section 5. Finally, Section 6 concludes this paper with a short
summary.
The focus of this paper is on the verification of feature models. Hence, we need to
first give an introduction about feature models. In the remainder of this section, we
introduce a metamodel of feature models. The content of this section is mainly based on
our previous work on feature modeling [12] and other related literature [1, 2, 3, 4, 7].
Figure 1 shows a metamodel of feature models. This metamodel consists of three
basic concepts: Feature, Refinement, and Constraint. All these concepts are subclasses
of the two concepts: Classifier and Relationship in UML Core Package [22].
2.1 Feature
A feature describes a product characteristic from user or customer views [2, 16],
which essentially consists of a cohesive set of individual requirements [17, 18, 19]. In
feature models, a feature is characterized by a set of attributes: name, description,
optionality, binding-time and binding-state.
A Propositional Logic-Based Method for Verification of Feature Models 117
Classifier Decomposition
+requirer
Require 1 Feature
*
* 1 +parent
Constraint Detailization
* Refinement
+requiree name 1
Exclude description 1 0..1
* 2 optionality
1..2 +child 0..1
binding-time
Specialization
ComplexConstraint binding-state
*
1..*
Relationship
2.2 Refinement
Refining a feature into its constituent features is called decomposition [1]. For
example, the edit feature in many software systems is often decomposed into three
sub-features: copy, paste and delete (see Fig. 2). Refining a feature by identifying its
attribute features is called detailization. For example, in graph editor domain, the
graph-move feature can be detailized by two attribute features: moving-mode and
moving-constraint. The difference between decomposition and detailization is often
omitted by most feature modeling methods, but the distinguishing between them does
have necessity for binding resolutions verification, because of the different constraints
implied by them: a fully decomposed feature must be removed if all its constituent
features have been removed; while a feature may still be bound, even if all its
attribute features have been removed. Refining a general feature into a feature
incorporating further details is called specialization [1]. Specialization is often used to
represent a set of variants of a general feature in feature models. A general feature is
also called a variation point feature (vp-feature) in [3].
Features with different abstract levels and granularities form a hierarchy structure
through refinement relationships between them. More strictly, most feature modeling
methods limit this hierarchy structure to be one or more feature trees. This limitation
contributes to the simplicity and understandability of feature models. [20] and [21]
present guidelines on transforming general structures into tree structures and
maintaining tree structures in feature modeling process.
2.3 Constraint
ComplexConstraint
ComplexConstraint
1..*
2
GroupConstraint CompositeConstraint BindingPredicate
GroupConstraint CompositeConstraint BindingPredicate
The process of feature model verification is depicted in Figure 5. There are five main
steps in the process. The first step is feature model construction. In this step, features,
refinement relations between features and constraints on features associated with a
software domain/product-line are systematically identified as in [12, 1, 3, 14]. Most
feature-oriented reuse approaches have provided tool supporting to this step. The
second step is to formalize constraints on features into logic sentences, which will be
presented in section 3.3. The third step is to compute atomic-sets contained in a
feature model, and use these atomic-sets to simplify constraints by replacing features
involved in constraints with their corresponding atomic-sets (see section 3.4). In our
approach, the second and third steps can be automated by tool supporting. After the
third step, operators can apply the SUS criteria to verify constraints on features (the
fourth step, see section 3.5), and further take binding resolutions at each binding-time
(the fifth step) and repeatedly apply the SUS criteria to verify these resolutions. The
fourth step can be automated by using model checkers, such as SMV [11].
A Propositional Logic-Based Method for Verification of Feature Models 121
As discussed above, tailoring and binding features in different binding times can be
viewed as changing the binding states of features. Usually, features in a feature model
can be partitioned into three sets according to their binding-states: BFSet, UFSet and
RFSet. The definition of the three set is:
BFSet = { f | f.binding-state = bound };
UFSet = { f | f.binding-state = undecided };
RFSet = { f | f.binding-state = removed };
The partition of features among the three sets may not be stable when current
binding time changes. Features in UFSet may move to the other two sets after
tailoring or binding actions. Once a feature moves to BFSet or RFSet, the truth value
of this feature will become the logical constant of True or False. Figure 6 shows the
transition of a feature’s binding-state between different binding times.
binding action
bound
undecided
removed
tailoring action
The three feature sets combined with the feature binding-state transition provide a
uniform view of these tailoring and binding actions which are taken both at the
development for reuse phase (i.e. construct-time) and at the development with reuse
phase (such as reuse-time, compile-time, and so on). At the beginning, all features in a
feature model belong to UFSet, and each feature’s binding-time is carefully decided.
Then, at the construct-time, feature model constructors put those construct-time
bound features into BFSet through binding actions. The set of construct-time bound
features is also called the commonality of a feature model, because these features will
exist in every application feature models. The construct-time is the only binding time
at the development for reuse phase. After the construct-time is the reuse-time. At this
time, requirement analyzers for individual applications will take some tailoring and
binding actions according their current reuse contexts. The result is that some features
in UFSet are partitioned into BFSet or RFSet. Similar tailoring and binding actions
122 W. Zhang, H. Zhao, and H. Mei
can be taken at each binding time, although the operators of these actions may change
from feature model constructors to requirement analyzers, even to end users at run-
time. Thus, the verification of feature models is transformed into checking the
rationality of tailoring and binding actions at each binding time, besides checking the
consistency of constraints in feature models.
Constraint/Predicate Formalization
f1 require f2 f1o f2
f1 mutex f2 ¬( f1 f2)
Mutex-Group(f1,f2,…fn) fj ,fk{ f1,f2,…fn }, jzk, ¬( fj fk)
None-Group(f1,f2,…fn) True
All-Group(f1,f2,…fn) (1d j d n fj) (1d j d n ¬fj)
single-binding(f1,f2,…fn) 1d i d n (1d j d n, j z i ¬fj) fi
multiple-binding(f1,f2,…fn) i=1,…,n fi
all-binding(f1,f2,…fn) i=1,…,n fi
single-bound(f1,…fn) require multiple-
single-bound(f1,…fn) o multiple-bound(g1,…gn)
bound(g1,…gn)
For the implicit constraints, we can represent them as the following rules. These
rules essentially reflect constraints imposed by refinements.
A pre-condition of binding a feature is that its parent must have been bound.
A post-condition of binding a feature is that all its mandatory children must
also be bound.
A post-condition of binding a fully decomposed feature is that at least one of
its constituent features must also be bound.
Similarly, there are also two kinds of rules when unbinding a feature:
A pre-condition of unbinding a feature is that all its children must have been
unbound.
A post-condition of unbinding a mandatory feature is that its parent must also
be unbound.
Table 3 shows constraints implied by typical refinement scenarios.
A Propositional Logic-Based Method for Verification of Feature Models 123
In above discussions, features are the basic units in tailoring and binding actions.
However, considering those pre-/post-conditions of binding or unbinding features (see
section 3.3), we can find that for any feature f, all its mandatory child features, its parent
feature (if f is a mandatory feature) and f itself can be treated as a whole in tailoring
and binding actions if the constraints implied by refinements are not broken. Thus,
features that can be treated as a whole in tailoring and binding actions can be viewed
as an atomic set, which is represented as atomic-set in this paper. More formally, the
atomic-set containing feature f can be constructed by the following four rules:
1. Create an empty set atomic-set, put f into it.
2. If mandatory feature g atomic-set, and this feature’ parent gp atomic-set,
then put gp into atomic-set.
3. If feature g atomic-set, feature gc is a mandatory child of g, and gc atomic-
set, then put gc into atomic-set.
4. Repeat rules 2 and 3, until no feature in atomic-set satisfies the two rules.
Legend
mandatory feature
optional feature
decomposition or detailization
specialization
atomic-set
To evaluate whether the proper tailoring and/or binding actions have been taken in
each binding time, we propose three properties (i.e. Satisfiability, Usability and
Suitability) to verify feature models. We call them “the SUS verification criteria” in
this paper.
Suppose {C1, C2, ..., Cn} is the set of logic sentences capturing all constraints in a
feature model and UFSetI denotes the set of all possible interpretations of the
proposition symbols in UFSet. After tailoring and binding actions at each binding
time, features in UFSet should satisfy the SUS verification criteria to ensure the
rationality of those tailoring and binding actions.
Satisfiability:
I UFSetI, I |= i=1,..., n Ci
Usability:
f UFSet, I UFSetI, I |= ( i=1,..., n Ci ) f
Suitability:
f UFSet, I UFSetI, I |= ( i=1,..., n Ci ) (¬ f )
The Satisfiability ensures that there is no inconsistency in tailoring and binding
actions. If this property is not satisfied, constraints on features or those tailoring and
binding actions of the current binding time should be reconsidered to eliminate
inconsistencies.
The Usability ensures that every feature in UFSet has the possibility of being
bound in some future binding time. If this property is not satisfied, it means that there
are one or more features that will not have the chances to be bound after the current
binding time. That is to say, these features actually have been removed from the
feature model. The possible causes may be that the operators have ignored the
tailoring actions on these features, or have done some improper tailoring or binding
actions, or some constraints themselves are wrong. These causes can be eliminated by
putting these features to RFSet, or by undoing some actions at the current binding
time, or by revising constraint on features.
The Suitability ensures that every feature in UFSet has the possibility of being
removed in some future binding time. If this property is not satisfied, it means that
there are one or more features that will not have the chances to be removed after the
current binding time. That is to say, these features actually have been bound. The
possible causes may be that the operators have ignored the binding of these features,
A Propositional Logic-Based Method for Verification of Feature Models 125
4 Case Studies
We applied our method to two real feature models which we have found in the
literature. The first one is the feature model of Lambda Feedback Control (LFC),
which is presented in [10]. The second one is the feature model of Window
Management Systems, which is presented in [1] as a case study of the FODA method.
In these two case studies, we use the model checker SMV to automate the fifth step of
feature model verification.
Figure 8 depicts the feature model of LFC. Table 4 shows the 6 atomic sets in the
feature model. In these atomic sets, only the atomic-set as0 contains 4 features, while
others contain only 1 feature.
After steps 2 and 3, we get the simplified constraints using atomic-sets as basic
variables (see the SPEC section in Figure 9). In this case, the number of refinement
imposed constraints decreases from 7 to 4 after step 3, and the number of constructor-
imposed constraints is unchanged. Then, we put these constraints to SMV to check the
three properties in the SUS verification criteria. Figure 9 shows the input files to SMV.
The result of this verification is that constraints in the feature model satisfy the
Satisfiability and the Suitability, but as3, as5 violate the Usability. As we are not familiar
with LFC domain, we do not know what the cause of these two violations is. However,
as an experiment, we omit the two violations and further verify the feature model at the
construct-time. At this binding-time, all construct-time binding (mandatory) features
are partitioned to BFSet. Besides the two violations having been found, we further
identify that as4, as6 violate the Suitability after these construct-time binding actions.
126 W. Zhang, H. Zhao, and H. Mei
Fig. 8. The Feature Model of Lambda Feedback Control (LFC) (Recreated from [10])
MODULE main
VAR
as0:boolean; as1:boolean;
as2:boolean; as3:boolean;
as4:boolean; as5:boolean;
as6:boolean;
ASSIGN This input is used to check the
Satisfiability of constraints.
//empty
This input is used to check the
//asi = 1;
Usability of .
//asi = 0; This input is used to check the
SPEC Suitability of .
AG !(
(as0 <-> (as1 | as2))&
(as4 <-> (as5 | as6))&
Refinement imposed constraints
(as4 -> as0)&
(as3 -> as2)&
The feature model of WMS is relatively a large and complex one, which contains 117
features, and about 12 constructor-imposed constraints involving 33 features. The
number of atomic-sets in this feature model is 93.
After the third step of feature model verification, constraints on features are
transformed into constraints on atomic sets. Figure 10 shows constraints in the form
of atomic sets. Although the number of possible variables in constraints has decreased
form 117 (features as the variables) to 93 (atomic-sets as the variables), the number of
constructor-imposed constraints does not decrease in this case. The reason for this is
that each atomic set, which is involved in constructor-imposed constraints, contains
only one feature. However, the number of refinement-imposed constraints does
decrease, since there are 5 atomic-sets that contain more than one features, and
refinement-imposed constraints on features in these atomic sets will be eliminated
after using atomic sets as the variables.
Then we apply the SUS verification criteria to the feature model before and at the
construct-time respectively, which is automated by using SMV. The result is that no
constraint or feature in the feature model violates the SUS criteria at these two phases.
5 Related Work
In [6], a first-order logic based variability validation method was proposed. In fact,
this method only employs those propositional constructs of the first-order logic to
capture constraints on features. The style of constraint representation adopted by this
method is, to some extent, different from the conventional propositional logic. Thus,
this style may not be directly parsed by those general-purpose model checkers.
Moreover, this method does not consider the binding-time property of features, i.e. it
does not distinguish between bound features and undecided features. Hence, this
method may not apply well when some features in a feature model are in the
undecided states.
128 W. Zhang, H. Zhao, and H. Mei
6 Conclusions
Acknowledgements
This work is supported by the National Grand Fundamental Research 973 Program of
China under Grant No. 2002CB31200003, the National Natural Science Foundation
A Propositional Logic-Based Method for Verification of Feature Models 129
of China under Grant No. 60233010, 60125206, and the Research Fund for the
Doctoral Program of Higher Education under Grant No. 20010001001.
The authors would like to thank Lu Zhang for his invaluable advice and help in
polishing this paper.
References
1. Kyo C. Kang, Sholom G. Cohen, James A. Hess, William E. Novak, A. Spencer Peterson,
“Feature-Oriented Domain Analysis Feasibility Study”, SEI-90-TR-21, Software
Engineering Institute, Carnegie Mellon University, Nov. 1990.
2. Kyo C. Kang, Sajoong Kim, Jaejoon Lee, Kijoo Kim, Euiseob Shin, Moonhang Huh,
“FORM: A Feature-Oriented Reuse Method with Domain-Specific Architecture”, Annals
of Software Engineering, 5:143-168, September, 1998.
3. Martin L.Griss, John Favaro, Massimo d’Alessandro, “Integrating Feature Modeling with
the RSEB”, in Proceedings of Fifth International Conference on Software Reuse, pp.76-85,
IEEE Computer Society, Canada, June 1998.
4. Gray Chastek, Patrick Donohoe, Kyo C. Kang, Steffen Thiel, “Product Line Analysis: A
Practical Introduction”, SEI-2001-TR-001, Software Engineering Institute, Carnegie
Mellon University, 2001.
5. Even-André Karlsson (editor) “Software Reuse: A Holistic Approach”, REBOOT
Methodology Handbook, John Wiley & Sons, 1995.
6. Mike Mannion, “Using First-Order Logic for Product Line Model Validation”, The Second
Software Product Line Conference 2002, LNCS 2379, pp.176–187, August 2002.
7. Dániel Fey, Róbert Fajta, and András Boros, “Feature Modeling: A Meta-Model to
Enhance Usability and Usefulness”, The Second Software Product Line Conference 2002,
LNCS 2379, pp.198–216, August 2002.
8. Mike Mannion, Barry Keepence, Hermann Kaindl, Joe Wheadon, “Reusing Single System
Requirements from Application Family Requirements”, in Proceedings of the International
Conference on Software Engineering, pp.453-462, 1999.
9. Hafedh Mili, Fatma Mili, Ali Mili, “Reusing Software: Issues and Research Directions”,
IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, VOL. 21, NO. 6, JUNE
1995.
10. Stefan Ferber, Jürgen Haag, Juha Savolainen, “Feature Interaction and Dependencies:
Modeling Features for Reengineering a Legacy Product Line”, The Second Software
Product Line Conference 2002, LNCS 2379, pp.235–256, August 2002.
11. SMV, “Model Checking @CMU, The SMV System”, http://www-2.cs.cmu.edu/~
modelcheck/smv.html.
12. Hong Mei, Wei Zhang, Fang Gu, “A Feature Oriented Approach to Modeling and Reusing
Requirements of Software Product Lines”, The 27th Annual International Computer
Software and Applications Conference, pp.250-255, November, 2003.
13. D. Amyot, L. Charfi, N. Gorse, T. Gray, L. Logrippo, J. Sincennes, B. Stepien, T. Ware,
“Feature Description and Feature Interaction Analysis with Use Case Maps and LOTOS”,
FIW’00, Glasgow, May, 2000.
14. Kwanwoo Lee, Kay C. Kang, Jaejoon Lee, “Concepts and Guidelines of Feature Modeling
for Product Line Software Engineering”, ICSR-7, pp. 62-77, 2002.
15. P. Zave, “Feature interactions and formal specifications in telecommunications”, IEEE
Computer, 26(8):20-29, August, 1993.
130 W. Zhang, H. Zhao, and H. Mei