Download the article Why is Testing Software Hard? written by Len DiMaggio (available in module Topic 1). It was written more than 10 years ago, so some of the examples in it are a bit dated. Also youll need to read around a few typos. None of these, of course, takes anything away from its informative and still highly relevant content.
Read the article, keeping in mind the question it sets out to answer. Now write down in your own words what you think the answer it gives. Next, in a separate section, write your own comments on this answer. For maximum credit, make sure to cover and critique all the points raised in the article.
a) Consider the pseudocode program below.
Input (score);
If score < 60 then
print ('fail');
else
print ('pass');
If score > 80 then
print ('with distinction');
End
How many feasible paths are there for this program?
Define a set of test cases that gives you 100% coverage of all feasible paths. Each test case should consist of a test input value with expected input (usually presented as a row in a table)
b) Given below is an example program listing (s and c represent a statement and a condition respectively):
s1;
if (c1) s2;
else s3;
s4;
if (c2) s5;
else if (c3) s6;
else s7;
s8;
(Note: "if (c) sn" means if condition c is true then execute statement sn)
Create the control flow diagram for the above program. Use this diagram to calculate the programs cyclomatic complexity C. Based on this value of C, how many tests will be needed for full coverage of all independent execution paths in the program? List these paths in terms of the constituent statements and truth values of conditions for example, one of the paths for this problem is: s1, !c1, s3, s4, c2, s5, s8.