next up previous
Next: Dependence analysis in Up: Regression Test Previous: Path Association

Data flow Test for Arrays

There are algorithms that give the du pairs for data flow testing in both the intra and the interprocedural cases. However, these algorithms can handle only scalar variables, while in the case of arrays either an under or an over assumption is made. In under assumption case, the array dependences are ignored the test and therefore it is unsatisfactory. In over assumption case, some of the pre-assume definition-use pairs do not exist. Even if a definition-use array pair exits, it is not sufficient to execute a path covering both the definition and a use as in the case of scalar. The existence of a definition-use pair may occur on some input values as the following example shows :

read(n)
for  i=1 to n do
    read(a[i])
endfor
.....
b = a[10];
Testing for n<10, there is not any definition-use pair during the program execution, though the definition-use pair really exists.

Compiler optimization and parallelization also require the knowledge of data dependences that can be characterized as value-based dependence and memory-based dependence. Value based dependence corresponds to definition-use pair for arrays. In compiler optimization and parallelization, it is enough to know that there is a dependence between to know that there is a dependence between two array elements. Therefore, a dependence test is sufficient.



Generated by latex2html-95.1
Fri Jul 12 14:53:37 EDT 1996