160 likes | 396 Views
Formalizing and Analyzing Feature models in Alloy. Jing Sun Computer Science j.sun@cs.auckland.ac.nz. Outline. Feature modeling The Alloy language Formalizing feature diagram Checking feature models Conclusion and future work. Feature & Feature Modeling. Conceptual modeling perspective
E N D
Formalizing and Analyzing Feature models in Alloy Jing Sun Computer Science j.sun@cs.auckland.ac.nz
Outline • Feature modeling • The Alloy language • Formalizing feature diagram • Checking feature models • Conclusion and future work
Feature & Feature Modeling • Conceptual modeling perspective • an important property of a concept • allows to express the commonalities and differences between concept instance • Domain engineering context • represents reusable, configurable requirements • Feature modeling • is the activity of modeling the common and the variable properties of concepts and their inter-dependencies and organizing them into a coherent model • feature model diagram
Feature & Software Engineering • Feature-oriented programming (Prehofer, 1997) • Can programs be created by composing features? • Next generation of OO programming? • Feature and advanced separation of concern • Feature is regarded as one dimension of concern (Tarr et al., 1999) • Can we separate feature concerns from other concerns? • Feature and software evolution and maintenance • Locating features from source code (Eisenbarth, 2003) • Understanding the implementation of certain features in programs
Feature & Software Engineering • Feature and requirements engineering • Representing and structuring the problem domain as features • A well known problem: Feature interaction in telecommunication domain (Zave, 1993) • Feature and software process • Feature-driven development: an agile, highly adaptive, software development process (Palmer and Felsing, 2002) • Feature and software reuse • FORM (Feature-Oriented Reuse Method) (Kang et al., 1998) • Modeling a software product line’s commonalties and variability in terms of features
Our current interest • Analyzing features and their relationships, organizing them into feature model • Representing feature models • Formalizing feature models • Analyzing and verifying feature models
Feature modeling • Basic relations among features • One feature may depend on another feature • One feature may exclude another feature • Feature Types • Mandatory features: must be included in the description of a concept instance • Optional features: may be included in the description of a concept instance • Or features: may have any non-empty subset of the or-features included in the description of a concept instance • Alternative features: …
Car Transmission Engine Pulls trailer Car Body Automatic Manual Electric Gasoline Feature diagram example • A car concept feature diagram
Applying formal methods • Alloy – a light-weight formal modeling language • Based on first order predicate logic • A subset of Z • Support automatic analysis • Applying Alloy to feature modeling • Formalizing a feature model • Checking a feature model (e.g., checking valid/invalid combination of features, semantic equivalence, …)
Feature language in Alloy sig Feature {} // define a set of features disj sig Concept extends Feature { // define a concept holds : set Feature // all possible configuration of a concept } // Depends - The selection of f2 depended on the selection of f1 fun Depends(c:Concept, f1:Feature, f2: Feature) { f1 in c.holds => f2 in c.holds } // Alternative feature type fun Alternative(c:Concept, pf:Feature, s:set Feature) { all f : s | Excludes(f, s-f) && Depends(f, pf) pf in c.holds => one f : s | Depends(pf, f) } … }
Feature model in Alloy open feature/FeatureModel static disj sig Automatic extends Feature{} static disj sig Manual extends Feature{} static disj sig CarBody extends Feature{} … static disj sig Car extends Concept{} fact {Mandatory(Car, Car, CarBody+Transmission+Engine)} fact {Optional(Car, Car, PullsTrailer)} fact {Alternative(Car, Transmission, Automatic+Manual)} fact {Or(Car, Engine, Electric+Gasoline)}
Checking & analyzing feature models • Checking valid/invalid feature configurations • assert correctness { all c : GPL | c.holds != GPL + Algorithm + Connected + Search + BFS + Graph + Undirected + Weighted } • Checking the source of unsatisfiability using “core extension” • Checking the solvability of feature models • Analyzing semantic equivalence of feature models
Checking & analyzing feature models • Semantic equivalence checking
Conclusion & future work • Defined a formal semantics for the feature modeling language in Alloy • Provide a precise and rigorous formal basis for the feature diagram • Identify basic relations in feature diagram and showed that other complex relations can be expressed as a combination of the two • Checking feature models using Alloy analyzer. • Dynamic feature model re-configurations • Feature interaction problem
Questions? Jing Sun Computer Science j.sun@cs.auckland.ac.nz