Download - Stm Emc Iiisem Midsem
-
8/11/2019 Stm Emc Iiisem Midsem
1/4
1
Birla Institute of Technology & Science, Pilani
Distance Learning Programme Division
M.S. Software Engineering, EMC2MID SEMESTER EXAMINATION (III SEM 2013)
SEEMC ZG552 - SOFTWARE TESTING METHODOLOGIES
Time: 1.5 hrs Date: 23.03.2012 Max. Marks: 30
1. The following function, written in a Pascal-like pseudo-code, takes as input a
string assumed to be a URL and checks to see if it contains any characters that are
illegal. Illegal URL characters are control characters (0-31, 127 decimal), space(32 decimal), and delimiter characters (">", "":
valid = false;case "
-
8/11/2019 Stm Emc Iiisem Midsem
2/4
2
For the following program, provide the following:
a. DD Path graph [2]b. The set of unique paths through the program [3]
c. For each feasible path, exact values of program variables that would cause
the path to be executed. [3]
d. Cyclomatic complexity [2]
2. Consider the specification given below. Identify the Causes and Effects in this
specification and then produce a cause effect graph showing their relationship.Using this truth table construct a set of test cases for this specification.
Specification: the basic cost of a health insurance premium is 100, however, thispremium can increase or decrease depending on two factors: their age and
whether they are a smoker. Customers who are above the age of 65 have their
insurance premium increased by 50. Customers who smoke have their premium
increased by 60. Customers whoare above the age of 65 and also smoke havetheir premium increased by 120 [5]
3. The basic cost of an insurance premium for drivers is 500, however, this
premium can increase or decrease depending on four factors: their age, theirgender, their marital status and number of penalty points. The input gender is
given by the character M for male and F for female. Drivers that are below the
age of 25, male and single face an additional premium increase of 1500. If adriver outside of this bracket is married or female their premium reduces by 200,
and if there are aged between 46 and 65 inclusive, their premium goes down by
100. Regardless of their status a driver will be charged an extra 20 for each
penalty point they have up to a maximum of 5. An entry of 0 is made for driverswith no penalty points
(1) int CarIns (int age, char gender, boolean married, int points) {
(2) Premium=500;(3) If ((age45) && (age5) {(14) points=5;
(15) }
(16) Premium = Premium + points*20;(17) return Premium;
(18) }
-
8/11/2019 Stm Emc Iiisem Midsem
3/4
3
Derive test cases and test data for the following White Box Software testing
methods:i. Statement Testing [2]
ii. Condition Coverage Testing [3]
iii. Multiple Condition Coverage Testing [4]
4.
For the following binary search procedure.
1. int BSearch (List, Elem, LEN)
2. int LEN, List [LEN], Elem;
3. {
4. int high, low, mid;
5.
6. low = 1;
7. high = LEN-1;
8. mid = (low + high) / 2;
9. while (Elem != List[mid])
10.
{11. mid = (low + high) / 2;
12. if (high < low)
13. return (FALSE);
14. else if (Elem == List[mid])
15. return (TRUE);
16. else if (Elem > List[mid])
17. low = mid + 1;
18. else
19. high = mid - 1;
20. }
21.
return (TRUE);22. }
a. Give the required associations to satisfy All-Defs for the variable mid (both
definitions of mid). [2]b. Give the required associations to satisfy All-Uses for the variable mid (both
definitions of mid). [4]
NOTE:
1. The Question Paper has 3 printed Pages and 4 Questions.
2. The Questions which requires justification for answers will be awarded marksonly if justification is provided. Else no marks will be awarded.
3. Just Answer to the Question. Do not write additional things which are not
required. It will not fetch you any marks.
4. Copying is a serious offence. You will be severely penalized if there are evidencesleading to the confirmation of my suspicion
-
8/11/2019 Stm Emc Iiisem Midsem
4/4
4