This diagram uses static information to display relations between classes.
Note
The information to form an ORD comes from tools like UML or source code. Source code is more difficult. There could be dependencies not expressed through inheritance, composition, or association (factory pattern). This is a problem that needs to be solved.
The ORD for program P is an edge-labeled graph where nodes represent the classes in P and the edges represent the inheritance, composition, and association relations.
Class Firewall
We want to identify the effect of a class change at the class level. Finding the CFW(X) for class X is the set of classes that could be affected to a change in class X. These need to be re-tested if X changes.
Kung et al. from Cluster Integration argues that if the ORD is not changed by a modification to X, the CFW needs to include subclasses of X, as well as classes composed with X, and the classes associated with X.
- represents a directed edge from C1 to C2.
- contains all the classes such that there is a directed path from to in the ORD where is the irreflexive, transitive closure of .
- The changed class set is ,
Cycles
In practice ORDβs are typically cyclic and Topological Sort cannot be applied (See Kung et al.).
- Cluster: The maximal set of nodes that are mutually reachable through the relation .
- Cycle breaking: Identify and remove an edge from a cluster and repeat until the graph becomes acyclic.
- Since each deletion results in a stub, we remove edges that are from associations (inheritance and composition are too hard to stub)
- The resulting test order can differ depending on where the cycle was broken