You are on page 1of 2

Feedback for question 1 of Minor Assessment 2

Most of the errors relate to NOT satisfying the definitions associated with each coverage criteria.
For example—in the case of all-defs, if there are 10 defs associated with the variables, then there will be 10 paths
listed and subsequent processing may eliminate some which has been subsumed or infeasible. Once the set of paths
has been finalised, then list the test cases associated with the final set of paths. (at least expected input and expected
output)

All-Defs Coverage
Test cases include a definition-clear path from every definition to some corresponding use (c-use or p-use).

Variable Def-use Path

arr-list[] 18 1, 2, 3, 4, 5, 6(T), 7, 8(T), 9, 14, 6(F), 15,16

n 14 1, 2, 3, 4, 5, 6(T), 7, 8(T), 9, 14, 6(F), 15, 16

key 18 1, 2, 3, 4, 5, 6(T), 7, 8(T), 9, 14, 6(F), 15, 16

low 26 1, 2, 3, 4, 5, 6(T), 7, 8(T), 9, 14, 6(F), 15,16

low 136 1, 2, 3, 4, 5, 6(T), 7, 8(F), 10(F), 12, 13, 14, 6(T), 7, 8(T), 9, 14, 6(F),
15,16

mid 78 1, 2, 3, 4, 5, 6(T), 7, 8(T), 9, 14, 6(F), 15,16

high 56 1, 2, 3, 4, 5, 6(T), 7, 8(T), 9, 14, 6(F), 15,16

high 116 1, 2, 3, 4, 5, 6(T), 7, 8(F), 10(T), 11, 14, 6(T), 7, 8(T), 9, 14, 6(F), 15,16

found 56 1, 2, 3, 4, 5, 6(T), 7, 8(T), 9, 14, 6(F), 15,16,16

found 96 1, 2, 3, 4, 5, 6(T), 7, 8(T), 9, 14, 6(F), 15


In the example above, I have just used line nos (for ease of reference) You can also use the control graph and its
nodes instead( A-L).

There will be 10 paths in the set to be processed -- as there are 10 defs

All-Uses Coverage
Test cases include a definition-clear path from every definition to each of its uses including both c-uses and p-
uses.

If you count up the number of c-use and p-use – there are 22, therefore you need to list the 22 paths first.

All-DU-Paths Coverage
Test cases include all du-paths for each definition. Therefore, if there are multiple paths between a given
definition and a use, they must all be included.

There are 32 paths associated with this coverage

You might also like