TL;DR
In the previous post, we gave an exercise on Test Paths in Directed Graphs. Today we provide the solution for that exercise. We will introduce you to software testing based on the remarkable book, Introduction To Software Testing by Paul Ammann and Jeff Offutt.
Solutions
- Give a path that is not a Test-Path in the above Directed Graph.
This is every path that has nodes that are not connected with an edge. For example, this is not a test-path:
n4, n8, n5, n1
because it does not start at one of the initial nodes.
- List All Test-Paths in the above diagram
This one is tricky because the solution is the infinitive number of test paths. We have a loop in the following test-path:
n0, n4, n8, n5, n1, n4
Other test-path that are not part of the loop:
n0, n3, n7
n0, n4, n7
n0, n4, n8
n1, n4, n7
n1, n4, n8
n1, n4, n8, n5, n9
n2, n5, n1, n4, n7
n2, n5, n1, n4, n8
n2, n5, n1, n4, n8, n5, n9
n2, n5, n9
n2, n6, n9
- Find test case inputs in Directed Graph for a + b so the corresponding test-path visits edge (n1, n3).
All values for a and b so a < b, for example a = -2, b = -1
Comments are closed.