STQA BEIT (2019-20)
QUESTION BANK FOR TEST 2 2019
5 MARKS QUESTIONS:
Q1. consider the following program segment:
main()
{
Int number,index;
1. printf(“Enter a no.”);
2. scanf(“%d”, &number);
3. index=2;
4. while(index <= number-1)
5. {
6. if(number%index==0)
7. {
8. printf(“Not a prime no.”);
9. Break;
10. }
11. Index++;
12. }
13. if(index==number)
14. printf(“Prime no.”);
15. }//end main
(a) Draw the DD graph for the program
(b) Calculate the cyclomatic complexity of the program using any three methods
(c) List all the independent paths
(d) Design test cases from all the independent paths
Q2. Consider the following program segment:
main()
{
Char chr;
1. printf(“Enter the special character: ”);
2. scanf(“%c”, &chr);
3. if(chr!=48) && (chr!=49) && (chr!=50) && (chr!=51) &&
(chr!=52) && (chr!=53) && (chr!=54) &&(chr!=55) &&
(chr!=56) && (chr!=57)
4. {
5. switch(chr)
6. {
7. Case ‘*’ : printf(“It is a special character”);
8. Break;
9. Case ‘#’ : printf(“It is a special character”);
10. Break;
11. Case ‘@’ : printf(“It is a special character”);
12. Break;
13. Case ‘!’ : printf(“It is a special character”);
14. Break;
15. Case ‘%’ : printf(“It is a special character”);
16. Break;
17. default : printf(“You have not entered a special character”);
18. Break;
19. }//end of switch
20. }//end of IF
21. Else
22. printf(“you have not entered a character”);
23. }//Enf of main()
(a) Draw the DD graph for the program
(b) Calculate the cyclomatic complexity of the program using any three methods
(c) List all the independent paths
(d) Design test cases from independent paths
Q3. Design the test cases for this program using decision table testing, in the profession
course subject to following conditions
Condition 1: Marks in JAVA >= 70
Condition 2: Marks in C++ >= 60
Condition 3: Marks in OOAD >= 60
Total in all 3 >= 220 and JAVA + C++ >=70. If aggregate marks of an candidate is >= 240
then he/she will be eligible for scholarship course otherwise he/she will be eligible for normal
course.
The program creates marks as three subjects and generates the following output.
1. Not eligible.
2. Eligible for scholarship course.
3. Eligible for normal course.
Q4. A program calculates the total salary of an employee with the condition that if the
1. Working hours are the less than or equal to 48 then give normal salary.
2. The hours over 48 on normal working days are calculated at rate of 1.25 off on the salary.
3. However on holidays or Sundays hours are calculated at the rate of 2 times of the salary.
Design the test cases using Decision table testing
2 MARKS QUESTIONS:
1. List out different methods of White Box Testing
2. Discuss statement coverage with example
3. Define Decision Node and Junction Node.
4. Write applications of path testing.
5. Define Cyclomatic Complexity.
6. Explain in brief Equivalence Class Testing
7. Define condition coverage with example
8. Define branch and decision coverage with example.
9. What do you mean by logic coverage criteria?