15-11-2012, 04:39 PM
Graph Coverage for Design Elements
Graph Coverage.ppt (Size: 561.5 KB / Downloads: 28)
OO Software and Designs
Emphasis on modularity and reuse puts complexity in the design connections
Testing design relationships is more important than before
Graphs are based on the connections among the software components
Connections are dependency relations, also called couplings
Data Flow at the Design Level
Data flow couplings among units and classes are more complicated than control flow couplings
When values are passed, they “change names”
Many different ways to share data
Finding defs and uses can be difficult – finding which uses a def can reach is very difficult
When software gets complicated … testers should get interested
That’s where the faults are!
Inter-procedural DU Pairs
If we focus on the interface, then we just need to consider the last definitions of variables before calls and returns and first uses inside units and after calls
Last-def : The set of nodes that define a variable x and has a def-clear path from the node through a callsite to a use in the other unit
Can be from caller to callee (parameter or shared variable) or from callee to caller as a return value
First-use : The set of nodes that have uses of a variable y and for which there is a def-clear and use-clear path from the callsite to the nodes
Inheritance, Polymorphism & Dynamic Binding
The defining and using units may be in different call hierarchies
When inheritance hierarchies are used, a def in one unit could reach uses in any class in the inheritance hierarchy
With dynamic binding, the same location can reach different uses depending on the current type of the using object
The same location can have different definitions or uses at different points in the execution !
Additional Definitions
Inheritance : If class B inherits from class A, then all variables and methods in A are implicitly in B, and B can add more
A is the parent or ancestor
B is the child or descendent
An object reference obj that is declared to be of type A can be assigned an object of either type A, B, or any of B’s descendents
Declared type : The type used in the declaration: A obj;
Actual type : The type used in the object assignment: obj = new B();
Class (State) Variables : The variables declared at the class level, often private
Summary—What Works?
Using sequence constraints is an easy way to design effective tests
The act of creating sequence constraints will often find problems
Call graphs are common and very useful ways to design integration tests
Inter-procedural data flow is relatively easy to compute and results in effective integration tests
The ideas for OO software and web applications are preliminary and have not been used much in practice