solution

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; also, “!c” means – condition c is false) Create the control flow diagram for the above program. Use this diagram to calculate the program’s cyclomatic complexity C.

Based on this value of C, answer the following questions: How many tests will be needed for full coverage of all independent execution paths in the program? List these independent execution 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.

 
"Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"
Looking for a Similar Assignment? Our Experts can help. Use the coupon code SAVE30 to get your first order at 30% off!