07.01.2013 Views

Lecture Notes in Computer Science 3472

Lecture Notes in Computer Science 3472

Lecture Notes in Computer Science 3472

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

300 Christophe Gaston and Dirk Seifert<br />

computations). In some cases, a data flow graph can be seen as an annotated<br />

control flow graph.<br />

In the follow<strong>in</strong>g, a flow graph is a representation of all statement sequences<br />

of the model, and a test case is a possible (<strong>in</strong>stantiated) <strong>in</strong>stance of a path <strong>in</strong><br />

the flow graph (i.e., <strong>in</strong>puts which execute the <strong>in</strong>struction sequence denoted by<br />

the path) [ZHM97]. Moreover each occurrence of a variable <strong>in</strong> a node is classified<br />

either as def<strong>in</strong>ition occurrence or as use occurrence. The latter can be further<br />

divided <strong>in</strong>to computational use or, if it is used with<strong>in</strong> a predicate, <strong>in</strong>to predicate<br />

use. In the follow<strong>in</strong>g necessary def<strong>in</strong>itions are given:<br />

• A def<strong>in</strong>ition clear path with respect to a variable x <strong>in</strong> a flow graph is a path<br />

where for all nodes <strong>in</strong> the path there is no def<strong>in</strong>ition occurrence of x .<br />

• A def<strong>in</strong>ition occurrence of variable x with<strong>in</strong> a node u reaches a computational<br />

use occurrence of x with<strong>in</strong> a node v, if and only if there is a path p =<br />

(u, w1,...,wn, v), such that (w1,...,wn) is def<strong>in</strong>ition clear with respect to x .<br />

• A def<strong>in</strong>ition occurrence of variable x <strong>in</strong> u reaches a predicate use occurrence<br />

of x on the edge (wn, v), if and only if there is a path p =(u, w1,...,wn, v),<br />

such that (w1,...,wn) is def<strong>in</strong>ition clear with respect to x and there exist a<br />

predicate occurrence of x associated to the edge from wn to v.<br />

• For both predicate and computational use occurrence, a def<strong>in</strong>ition occurrence<br />

of x <strong>in</strong> u feasibly reaches the use occurrence of x , if and only if there is a<br />

path p, such that there exists <strong>in</strong>puts which enforce the execution of p.<br />

The simplest data flow criteria rely on paths that start with the def<strong>in</strong>ition of<br />

a variable and end with the use of the same variable. The follow<strong>in</strong>g criteria are<br />

adapted from the work of Frankl and Weyuker [FW88].<br />

AtestsuiteT satisfies the all def<strong>in</strong>itions coverage criterion, if and only if<br />

for all def<strong>in</strong>ition occurrences of a variable x , such that there is a use occurrence of<br />

x which is feasibly reachable from the def<strong>in</strong>ition, there is at least one element <strong>in</strong> T<br />

which is a numerical <strong>in</strong>stance of a path p, that conta<strong>in</strong>s a sub path through which<br />

the def<strong>in</strong>ition of x reaches some use occurrence of x . Thus, the all def<strong>in</strong>itions<br />

coverage criterion ensures that all def<strong>in</strong>ed variables will be tested at least once<br />

by one of their uses <strong>in</strong> the model. However, this is <strong>in</strong>sufficient as tester require<br />

to test all uses of all variable def<strong>in</strong>itions. It is ensured by the all uses criterion.<br />

AtestsuiteT satisfies the all uses coverage criterion, if and only if for all<br />

def<strong>in</strong>ition occurrences of a variable x and for all use occurrences of x which are<br />

feasibly reachable from the def<strong>in</strong>ition, there is at least one element <strong>in</strong> T which<br />

is a numerical <strong>in</strong>stance of a path p that conta<strong>in</strong>s a sub path through which the<br />

def<strong>in</strong>ition of x reaches the use occurrence.<br />

The previously described criteria have been specialized to take <strong>in</strong>to account<br />

that a use occurrence can be a computational use or a predicate use [RW85].<br />

However, the all uses coverage criterion does not ensure that all possible ways<br />

to reach a use occurrence have been tested. As there may be several sub paths<br />

which allow a def<strong>in</strong>ition occurrence of a variable to reach a use occurrence of this<br />

variable. Note that some of these paths may be <strong>in</strong>f<strong>in</strong>ite due to cycles and cannot<br />

be covered. A possible solution is to restra<strong>in</strong> to cycle free sub paths. The only

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!