next up previous
Next: Data flow Test Up: Detecting Affected Definition-Use Previous: Value Association

Path Association

The def-use association that are affected on a path whose condition has changed must be retested. A path condition can be altered because of an explicit change in an operator in predicate statement. For example,

...
1.  X=2;            /* replace with X = 3 */
2.  if (A > 1) then /* replace with A < 1 */
3.     Y = X + 5;
4.  if (X > A) then 
5.     Y = X -5;
6.  T = Y + 6;
...

 
Figure 3: An example of code changes in program segment

if statement 2 is changed to ``if A < 1 then ``, then no new def-use association are created, but any def-use association that is control dependent on statement 2 may be affected by the change. In figure X, you can see some example how backward and forward test can be used some different changes. Let's look at an example in Figure 3. Assume that you make a change in this code and how forward and backward test find the definition-use pairs that has to be retested.

Change 1 inserts a use of X in statement 5. Then backward test identifies the def-use association to new use of X. Definition-use from statement 1 to 5 has to be tested. Forward test identifies th def-use association that are affected by the change in the definition of Y in statement 5. Therefore, def-use association from statement 5 to 7 and from 7 to 9 have to be tested.

Change 2 deletes the use of X in statement 5. No need to backward test. Forward test identifies the def-use associations affected by this change in definition of Y again. Therefore, as in change 1, def-use association from 5 to 7 and from 7 to 9 has to be retested.

Change3 inserts a definition of Y in statement 5. No need to backward test because it is new definition and only effects flowing lines. Forward test identifies the def-use association to be retested. Again, as in change1 and 2, def-use from 5 to 7 and from 7 to 9 have to be retested.

Change4 deletes the definition of Y in the statement. Backward test identifies the definition of X that reach statement 5 to form new def-use association to be tested, then forward test identifies the def-use association affected by the change in statement 5. At this time def-use association from 0 to 7 and 7 to 9 have to be tested.



next up previous
Next: Data flow Test Up: Detecting Affected Definition-Use Previous: Value Association



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