NATIONAL INSTITUTE OF TECHNOLOGY ROURKELA-769008
MID-SEMESTER EXAMINATION, 2023
SESSION: 2022 – 2023 (Spring)
B. Tech. 8th / M. Tech. 2ndSemester
Subject code: CS6404 Subject Name: Software Testing Dept. Code: CS
No. of pages: 2 Full Marks: 60 Duration: 2hrs
Figures at the right hand margin indicate marks.
All parts of a question should be answered at one place.
Answer all questions.
Q. No. Particulars Marks
1.
(a) Suppose 10 different test case design strategies are successively used to test a program. Each 2*10=20
test case design strategy is capable of detecting 40% of the bugs existing at the time of
application of the strategy. If 1000 bugs existed in the program, determine the number of
bugs existing at the end of testing.
(b) At least how many test cases are required to achieve MC/DC coverage of the
following code segment
if((a>5 and (b<100) and (c>50)) x = x+1;
(c) Give a positive and a negative test scenario for the “Date of Birth” field of the
Student Enrollment Page in NIT Rourkela website.
A defect –seeding program inserts 81 defects into an application. Inspections and testing
(d)
found 152 defects. Of these, 72 were seeded defects. What is the expected number of
defects that remain undetected in the application?
(e) What do you mean by equivalent mutants? Give an example of equivalent mutants.
Give an example where it is not possible to determine the state of data variable by just static
(f)
analysis of the code.
(g) Suppose a program contains 5 decision inputs, if there are 4 choices at each decision point,
how many test cases are necessary for branch testing?
(h)
What do you mean by concolic testing? Give an example of concolic tester.
(i)
Give an example of a bug that is detected by the black-box test suite, but is not detected by
the white-box test suite. Justify your answer.
(j) Suppose two programmers are assigned the same programming problem and they develop
this independently. Explain how you can compare their programs with respect to
understanding difficulty.
2. 10+5+5=20
(a)
A mobile phone service provider uses a program that computes the monthly bill of
customers as follows:
a. Minimum Rs 400 for up to 150 calls
b. Plus Rs 1 per call for the next 80 calls
c. Plus Rs 0.50 per call for the next 70 calls
d. Plus Rs 0.30 per call for any call beyond 300 calls
Design test cases for this program using equivalence class testing technique.
(b) A program calculates the GCD of three numbers in the range [1, 50]. Design test cases for
this program using robust testing, and worst-case testing methods.
Consider the following system:
2
(c) Passengers who travel more than 50,000 km per calendar year in addition, pay cash for
tickets or have been travelling regularly for more than 8 years are to receive free round trip
ticket around India. Passengers who travel less than 50,000 km per calendar year and have
been availing railway service regularly for more than 8 years also get a free round ticket
around India.
Design test cases for this system using decision table based testing.
Consider the following program 10+10=20
3.
(a)
#include <stdio.h>
main{
int a,b,c,d;
clrscr();
printf(“Enter the two variables a, b”);
scanf(“%d %d”, &a , &b);
printf(“Enter the option 1:Addition, 2:Subtraction,
3:Multiplication, 4:Division”);
scanf(“%d”,&c);
switch(c){
case1:d= a+b;
printf(“Addition of the two no.=%d”,d);
break;
case2:d= a-b;
printf(“Subtraction of the two no.=%d”,d);
break;
case3:d= a*b;
printf(“Multiplication of the two no.=%d”,d);
break;
case4:d= a/b;
printf(“Division of the two no.=%d”,d);
break;
}
}
i. Draw the CFG for the above program.
ii. Calculate the cyclomatic complexity of the program.
iii. List all the independent paths.
iv. Design all the test cases from the independent paths.
(b) Consider the program given in part (a) and perform static data flow analysis by finding out
the define-use-kill patterns for all the variables in the source code.