Question: Given the following function: int ex1 (int x, int y) { int z=0; if (x3 && y 5){ z=1; x= y-x; if (y == 5

Given the following function:

int ex1 (int x, int y) {

int z=0;

if (x3 && y 5){

z=1;

x= y-x;

if (y == 5 || zy){

z:= 2;

y:=z;

}

}else{ if (x==3 && y z){

z=0;

y=x;

}

}

y=z;

}

Generate a test suite which gives the maximum coverage with the statement coverage criterion.

Exercise 2

Write a simple piece of code (pseudo-code is also fine), for which it is impossible to reach 100% statement coverage.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!