Homework #11, Control Flow Coverage For the following program P written in pseud
ID: 3686415 • Letter: H
Question
Homework #11, Control Flow Coverage For the following program P written in pseudo-code, given the test set T: T = {t1 = <7, 2>, t2 = <3, 1>}
5) What is the domain for decision coverage of P?
6) What is the decision coverage for T?
Program P
1) integer X, Y, Z;
2) input (X, Y);
3) if (X<0 or X>8 or Y<1 or Y>3)
4) {
5) output (“Boundary condition failure on inputs.”);
6) } // end input check
7) else
8) {
9) Z = 0;
10) if (X < 5)
11) {
12) Z = X + Y;
13) if (Y == 1)
14) {
15) Z = X ^ 2;
16) } // end if (Y==1)
17) } // end if (X<5)
18) else
19) {
20) Z = Z – X;
21) if (Y == 0)
22) {
23) Z = Z * Z;
24) } // end if (Y==2)
25) else
26) {
27) Z = Z + X;
28) } // end else !(Y==2)
29) } // end else !(X<5)
30) output (X,Y,Z);
31) } // end else legal inputs 32) end;
Explanation / Answer
5) What is the domain for decision coverage of P.
X = -1, 0, 1 , 7, 8 ,
Y= 0,1, 2, 3, 4 ,
6) What is the decision coverage for T?
Test case X Y t1 X=7, true Y= 2 ,T rue t2 X= 3, True Y= 1, TrueRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.