230 likes | 317 Views
SPLGraph: Towards a Formalism for Software Product Lines Itay Maman IBM Research – Haifa Goetz Botterweck Lero – The Irish software Engineering Research Centre May 2 nd 2010, PLEASE 2010. Modern Software Systems. Heterogonous artifacts Source code: C, Java, DSLs, … Design documents
E N D
SPLGraph: Towards a Formalism for Software Product LinesItay MamanIBM Research – HaifaGoetz Botterweck Lero – The Irish software Engineering Research CentreMay 2nd 2010, PLEASE 2010
Modern Software Systems • Heterogonous artifacts • Source code: C, Java, DSLs, … • Design documents • User manuals • Licenses • Presentations • Heterogonous artifact-specific tools/editors
Multi Product Tool Stack File Repository P1 configuration Feature Model Review\Edit Variability Variability Variability Variability Requirements Tool Design Tool IDE/Compiler … P1 Artifacts Requirements Design Tests … Design Tests … Requirements Design Code Requirements …
Difficulties • Rework: Implementing variability in each tool • Lack of system wide traceability • Viewers cannot be used without the editors • E.g., Lint cannot be used without a variability-enabled IDE • Features are a special construct
Tool Stack: Centralized Variability File Repository P1 configuration Feature Model + Materializer P1 Artifacts Requirements Design Tests … Design Tests … Requirements Design Code Requirements … Review\Edit Variability UI Variability UI Variability UI Variability UI Requirements Tool Design Tool IDE/Compiler …
QA Scenario File Repository P1 configuration Feature Model + Materializer Plain compiler – no variability support P1 Artifacts Design Tests Design Tests Requirements Code Requirements Tool Compiler P1 can now be tested
Can Materialization be Centralized? • Vision: a dedicated, generic, product line tool • Handles a wide range of artifacts • Relieve tool vendors from implementing variability mechanisms • Similar to source control • IDEs do not try to roll out their own source control mechanism • (Other than UI support) • Variability is more difficult – finer granularity
Striking a balance • High Level Representations (E.g., UML) • Operations: deleteClass, replaceClass, deleteRequirement, … • Representation is too Specific => Operations are not generic • (Too many operations to implement) • Low Level Representations: Stream of bits • Only three operations: deleteBit(offset), insertBit(offset, value), replaceBit(offset, value) • Sensitivity to changes: when content changes all offsets must be recalculated • (Impractical)
Wish List • Insensitivity to changes • Local changes in content => local changes in representation • Generic: A small number of variability operations • Work on all artifacts • Self sustainable: Variability can be defined on variability • Decidable • Solution: A directed, labeled, graph • Requires: A translation scheme (bi directional)
SPLGraph • A directed graph <V,E> • Defined as a 7-tuple • Label function: L(x) : V E → String • A set of mutation vertices: M • A set of decision vertices: D • Three special vertices: T, F, X • (Formalization & Patterns are in the paper)
Simple Example: “class a extends b”(no variability) s a b e0 extends
a b a b e1 e1 subject subject c c target target g e1 g e1 key key Mutation Vertex g apply(g)
x a e2 s e1 f y h b t e3 condition T Decision vertex h
Traversal from vertex s x a e2 s e1 f y h b t e3 condition T
Algorithm: Materialize • Inputs: G, N, P, s • G: An SPLGraph • N, P: Sets of decision vertices (disjoint) • s: A vertex • Steps: • Set the decision of all vertices in N to be F • (Add a condition edge) • Set the decision of all vertices in P to be T • (Ditto) • Q = All vertices reachable from s • (respecting the traversal semantics of decision vertices) • For each mutation vertex q in Q do apply(q)
a b s extends subject c e1 f target h g extends t key a b s extends subject c e1 f target condition T h g extends t key Example: “class a extends b” materialize(G,{},{h},s)
f h2 d … e2 s h1 a b f extends e1 subject subject c t target g s1 g1 e3 key extends key target condition f Everything is a Vertex!
Prototype Tool • Can Import existing Java Code • Program elements can be marked as optional • Field, Method, Class, Package • Materialize => Generates a new program • Some of the optional elements are excluded • Determined by a user decision • The algorithm has no Java knowledge! • Can be extended by writing new translators
Future • Product line support in IBM/Rational Jazz platform • First steps: Rhapsody 7.5.2 • Source Control vs. Product Lines • Graph-oriented Database • Streamlining the translation schemes API
Summary • Simplicity: A single kind of transformation • Namely: Edge rerouting • Self-sustainability: “Everything is a vertex” • The model can define variability on itself • Similar to the Object-model of object-oriented languages • (See: Smalltalk) • Decoupling materialization from artifacts