Question: 1
Use the following code;
x=1
y=2
z=3
If (x = = 2)
{
print "Hi There !";
}
else
{
print "Good bye";
}
z=x + y;
if (z ==4)
{
print "Welcome Back!";
}
else
{
print "Thank you";
}
How many test cases, at minimum, are required for statement coverage?
Question: 2
Use the following code;
x=1
y=2
z=3
If (x = = 2)
{
print "Hi There !";
}
else
{
print "Good bye";
}
z=x + y;
if (z ==4)
{
print "Welcome Back!";
}
else
{
print "Thank you";
}
How many test cases at minimum are required to test branch / decision coverage?
Question: 3
Use the following code;
x=1
y=2
z=3
If (x = = 2)
{
print "Hi There !";
}
else
{
print "Good bye";
}
z=x + y;
if (z ==4)
{
print "Welcome Back!";
}
else
{
print "Thank you";}
How many test cases at minimum are needed to test the path coverage?
Question: 4
A College Enrollment application used by ABC College calculates the amount each student has to pay for gym and computer lab usage. The application asks for Student ID, Name and Student's major. Then the application calculates the fee. If student's major is Computer Science, they have to pay the full computer lab fee. If the student's major is not Computer Science, they have to pay only 1/3 rd of the computer lab fee. All students have to pay for the gym membership. How many tests are required for path coverage of the above application?
Question: 5
Consider the following perl code;
$x = 100;
If ($account > 100)
{
for ($deposit = 1 ; $deposit > 3 ; $deposit ++)
{$x=$x+1;
}
if ($account <= 100)
{
for ($withdraw = 0; $withdraw > 2 ; $withdraw ++)
{
$x=$x-1;
}
}
$x=$x+100;
How many test cases at a minimum are needed to test the path coverage?