EXERCISES
EXERCISES
5.1 In Example 5.2, we state “Under this assumption, when run as
the first test, t
3
is likely to fail because the expected output will not
match the output generated by SATM
.” Under what conditions
will this statement be false ?
5.2 Given program P and test t, explain the difference between an
execution trace of P against t when recorded as (a) a sequence of
nodes traversed and (b) a set of nodes traversed. Use storage space
as a parameter in your explanation. Give one example where a
sequence is needed and a set representation will not suffice.
5.3 Draw the syntax trees in Example 5.7 not shown in Figure 5.6.
5.4 Write an algorithm that takes two syntax trees T
r
and T
r
as inputs
and returns true if they are identical and false otherwise ...