Title: A Case Study in Product Lines: A GenVoca Example
1A Standard Problem for Evaluating Product-Line
Methodologies Roberto E. Lopez-Herrejon and Don
Batory Department of Computer Sciences University
of Texas At Austin Third International
Conference on Generative and Component-Base
Software Engineering (CGSE 2001) September 10-13,
Erfurt, Germany
2Introduction
- PL are designs for a family of related
applications - Many methodologies for PL design
- FORM, FODA, FAST,
- The area is immature
- Unfamiliar domains elevators, buoys, phone
- No attempt to compare and evaluate
- Choice of methodology based on convenience not
fact!
3Introduction
- Methodology comparison essential for Product-Line
research to mature - Other CS fields have faced same problem
- Standard problems for method comparisons
- Standard Problem Graph algorithms domain
- Reference Example GenVoca design and
implementation
4A Standard Problem
- Graph Product Line (GPL)
- A GPL family member is distinguished by the set
of features that implements - A GPL application implements
- Directed or Undirected, with optional weights
- Breadth First Search or Depth First Search
- At least one algorithm Numbering, Connected
Comp, Strongly Connected Comp, Cycle Checking,
MST, Single-Source Shortest Path
5Graph Product Line
- PLs model features in applications
- Grammar provide convenient specification of
options
GPL Gtp Wgt Src Alg Gtp Directed
Undirected Wgt Weighted Unweighted Src
DFS BFS None Alg Number Connected
StronglyConnected Cycle MST Prim
MST Kruskal Shortest
Optional Features In GPL
6Example Application 1
- Implements Number, Cycle using DFS on Unweighted
Directed graphs
GPL Gtp Wgt Src Alg Gtp Directed
Undirected Wgt Weighted Unweighted Src
DFS BFS None Alg Number Connected
StronglyConnected Cycle MST Prim
MST Kruskal Shortest
7Example Application 2
- Implements MST Prim using no search on Weighted
Undirected graphs
GPL Gtp Wgt Src Alg Gtp Directed
Undirected Wgt Weighted Unweighted Src
DFS BFS None Alg Number Connected
StronglyConnected Cycle MST Prim
MST Kruskal Shortest
8Feature Constraints
- Applications are characterized by the features
they implement - Not all features are compatible
- Selection of one feature may enable, disable or
require another feature
9GPL Feature Constraints
10A Reference Implementation
- GenVoca
- Key idea programs are values
- Constants
- f program with feature f
- g program with feature g
- Functions are program extensions
- i(x) adds feature i to program x
- j(x) adds feature j to program x
11GenVoca
- A multi-featured application is an equation
- a1 i ( f )
- a2 j ( g )
- a3 i ( j ( f ))
- Design Rules
- Capture the feature constraints of the domain
- Example MST feature requires Weighted feature
12GPL Constants and Functions
13Example Application 1
- Implements Number, Cycle using DFS on
- Unweighted Directed graphs
App1 Number ( Cycle ( DFS ( Unweighted (
Directed ) ) ) )
14Example Application 2
- Implements MST Prim using no search on
- Weighted Undirected graphs
App2 MST Prim ( None ( Weighted ( Undirected )
) )
15Mixin Layer Implementations
class Directed class Graph class
Vertex class Edge
Graph
Vertex
Edge
class DFSltxgt extends x class Graph extends
x.Graph class Vertex extends x.Vertex
Graph
Vertex
class A extends DFSltDirectedgt
A DFS (Directed)
16Graph Implementation
- Graph implementations define
- Graphs, vertices, adjacency, edges, annotations
- Series of 3 improving designs
17Adjacency Lists Representation (G)
Graph Object
9
Vertices List
V1
V3
V1
V2
V3
7
11
Vertex V1
Adjacent Vertices
V2
V2
V3
Weights List
7
9
Graph Example
18Adjacency Lists Representation
- Pros
- Simple, followed legacy design of earlier work
- Works for most feature implementations
- Cons
- Edges must be computed from adjacency lists
- A parallel list for each edge annotation
- Next
- Eliminate parallel lists
19Neighbor List Representation (GN)
Graph Object
9
Vertices List
V1
V3
V1
V2
V3
7
11
Vertex V1
V2
Vertex Object
V2
V3
List of Neighbors
Graph Example
Integer Object
9
7
Neighbor Object
20Neighbor List Representation
- Pros
- List accesses to obtain annotations are reduced
- Simplified design of some mixin-layers
- Cons
- Algorithms that manipulate edges explicitly still
must compute them from Neighbors list - Next
- Represent edges explicitly
21Edge-Neighbor Representation (GEN)
Graph Object
Edges List
9
Vertices List
V1
V3
V1
V2
V3
E2
E1
E3
7
11
List of Neighbors
V2
Vertex V1
V2
V3
Graph Example
E1
E2
Neighbor Object
Edge E1
Edge E2
Edge E3
V1
V2
7
V1
V3
9
V3
11
V2
22Edge-Neighbor Representation
- Pros
- Handles algorithms that manipulate edges
explicitly
23Lesson Learned 1Reify Conceptual Objects
GN
GEN
G
Edge
Neighbor
Graph
Vertex
24Lesson Learned 2Avoid Premature Optimizations
Graph
Vertex
Edge
Neighbor
Representation G
25Profiling Results
- Benchmark performance of 3 designs
- Three kinds of algorithms
- Graph creation and traversal
- Copying a graph with edge annotations
- Use of edges explicitly
- Effect of layering
- Windows 2000, 700 Mhz, 196MB RAM
26Number Vertices Profiling Results
- Graph creation and traversal
- Design G 6 to 22 GN, 75 to 120 GEN
- Total Execution Time G 5 GN, 9 GEN
- Most of the Execution Time in file reading
27Strongly Connected Components Profiling Results
- Copying a graph with edge annotations
- Design G 2 GN, 6 GEN
- Graph creation cost is different
- Differences swamped by large computation times
28MST Kruskal Profiling Results
- Algorithms that use edges explicitly
- Design GEN 43 to 98 G, 59 to 120 GN
- Differences between G and GN
- edge computation
- object creation
29Performance Summary
- G is preferred for
- unweighted graphs
- applications without use of explicit edges
- GEN is preferred for
- applications using explicit edges
30Effect of Layering
- Profile GPL two largest members
- Each has 10 layers
- StronglyCC, Shortest, Number, Cycle
- Prim, Kruskal, CC, Number, Cycle
- Collapsed class hierarchy manually
31Effect of Layering
Collapsing Class Hierarchy
Method
Class in a layer
32Effect of Layering
- First G (0 to 2) GN (1 to 1) GEN (1 to 1)
- Second G (0 to 3) GN (0 to 5) GEN (1 to 1)
- Negligible difference in this domain
- Few methods are overridden
- Overriding involves fewer than 3 layers
33Conclusions
- PL area is maturing we need to be compare and
contrast different PL design methodologies - Select methodologies based on fact, not
convenience - Better understand fundamental concepts of this
area - To do this, we proposed a standard problem for
all to use - Graph algorithms domain
- Domain consists of graph applications
- Simple, yet illustrative for PL designs and
modeling issues
34Conclusions
- Presented GenVoca reference implementation
- actually 3 different implementations
- differences in which conceptual objects were
reified - each implementation with own performance
characteristics - found layering had negligible impact on
performance (this is domain specific not a
general result) - Source code available at
- http//www.cs.utexas.edu/users/dsb/GPL.html
35Questions