This is an undergraduate assignment. Software Testing, please follow instructions in the file
Microsoft Word - A08se4367cf v4.docx SE 4367, Software Testing Homework #8, Control Flow Coverage For the following program P1 written in pseudo-code, given the test set TX: T = {t1 = <4, 2="">, t2 = <90, 0="">, t3 = <56, 1="">} a) What is the statement coverage of P1 for TX? b) What is the decision coverage of P1 for TX? c) What is the condition coverage of P1 for TX? d) Provide an adequate test set TA with respect to statement coverage for P1. e) Provide an adequate test set TA with respect to decision coverage for P1. Program P1 1) integer X, Y, Z; 2) input (X, Y); 3) if ((X≥0 AND X≤100) AND (Y>0 AND Y<4)) 4)="" {="" 5)="" z="-1;" 6)="" if="" (x="">< 60)="" 7)="" {="" 8)="" z="0;" 9)="" if="" (x=""> 80 AND Y == 1) 10) Z = 59; 11) Z = Z + 3; 12) } 13) else // !(X<60) 14)="" {="" 15)="" z="61;" 16)="" if="" (y=""> 2) 17) Z = 99; 18) else // !(Y>2) 19) Z = 62; 20) } 21) output (X,Y,Z); 22) } 23) else // not legal inputs 24) output (“ERROR *** Illegal inputs.”); 25) output (“Program ends.”); 26) end; For the following program P2 written in pseudo-code, given the test set TY: TY = {t1 = <-1, 2="">, t2 = <7, 0="">, t3 = <6, 1="">} f) What is the statement coverage of P2 for TY? g) What is the decision coverage of P2 for TY? h) What is the condition coverage of P2 for TY? i) Provide an adequate test set TB with respect to statement coverage for P2. j) Provide an adequate test set TB with respect to decision coverage for P2. Program P2 1) integer X, Y, Z; 2) input (X, Y); 3) if (X<0 or="" x="">8 or Y<1 or="" y="">3) 4) output (“ERROR *** Illegal inputs.”); 5) else // legal inputs 6) { 7) Z = 0; 8) if (X < 5)="" 9)="" {="" 10)="" z="X" +="" y;="" 11)="" if="" (y="=" 1)="" 12)="" z="X" ^="" 2;="" 13)="" }="" 14)="" else=""><5) 15) { 16) z = z – x; 17) if (y == 0) 18) z = z * z; 19) else // !(y==0) 20) z = z + x; 21) z = z + 1; 22) } 23) output (x,y,z); 24) } 25) output (“program ends.”); 26) end; grading rubric parts are worth 10 points each. each coverage part 5 points for numerator and 5 for denominator if in ratio (fraction) form coverage can be either un-simplified ratios (fractions), decimal numbers [0,1], or percentages if expressed as a decimal, two places is sufficient if expressed as a percentage, to the nearest percent is sufficient if a decimal or percentage answer for the coverage is provided and wrong, but the work is shown with a correct numerator and an incorrect denominator, only take 5 points off. (incorrect numerator, -10 points) for each test adequacy part, any uncovered element means the answer is wrong, -10 points for each test adequacy part, any extra elements added to the adequate test set (not a minimal test set), -5 points 15)="" {="" 16)="" z="Z" –="" x;="" 17)="" if="" (y="=" 0)="" 18)="" z="Z" *="" z;="" 19)="" else="" !(y="=0)" 20)="" z="Z" +="" x;="" 21)="" z="Z" +="" 1;="" 22)="" }="" 23)="" output="" (x,y,z);="" 24)="" }="" 25)="" output="" (“program="" ends.”);="" 26)="" end;="" grading="" rubric="" parts="" are="" worth="" 10="" points="" each.="" each="" coverage="" part="" ="" 5="" points="" for="" numerator="" and="" 5="" for="" denominator="" if="" in="" ratio="" (fraction)="" form="" coverage="" can="" be="" either="" un-simplified="" ratios="" (fractions),="" decimal="" numbers="" [0,1],="" or="" percentages="" ="" if="" expressed="" as="" a="" decimal,="" two="" places="" is="" sufficient="" ="" if="" expressed="" as="" a="" percentage,="" to="" the="" nearest="" percent="" is="" sufficient="" if="" a="" decimal="" or="" percentage="" answer="" for="" the="" coverage="" is="" provided="" and="" wrong,="" but="" the="" work="" is="" shown="" with="" a="" correct="" numerator="" and="" an="" incorrect="" denominator,="" only="" take="" 5="" points="" off.="" (incorrect="" numerator,="" -10="" points)="" for="" each="" test="" adequacy="" part,="" any="" uncovered="" element="" means="" the="" answer="" is="" wrong,="" -10="" points="" for="" each="" test="" adequacy="" part,="" any="" extra="" elements="" added="" to="" the="" adequate="" test="" set="" (not="" a="" minimal="" test="" set),="" -5="">