December
1998 QUESTION 5 Total Marks: 20 Marks |
Click here to access other
questions
SUGGESTED SOLUTIONS
|
A variety of techniques exists for testing
software.
|
||||||||||
(a) | Use the basis path testing method to consider the following flow graph: | |||||||||
(i) Identify the predicate nodels in this flow graph. | [2] | |||||||||
Predicate Nodes: 1, 2,
62 marks to be awarded if candidate gets all three correct. 1 mark to
be awarded if candidate gets two correct. 0 marks to be awarded if candidate gets only one
correct.
|
||||||||||
(ii) Use three different methods to calculate the value of cyclomatic complexity, V(G). Indicate all working used to derive your answer for V(G). | [3] | |||||||||
The three
methods for calculating V(G): 1) Using Number of Regions Method: V(G)= Number of regions = 4. (1 mark) All regions must be correctly identified before the 1 mark is awarded. 2) Using the Number of Predicate nodes + 1 Method. 3+1 = 4 (1 mark) 3) Using the Edges - Nodes + 2 Method. V(G) = 11 - 9 + 2 = 4 (1 mark)
|
||||||||||
(iii) Based on your answer to (i), derive the basis set of test-paths. | [2] | |||||||||
Basis set of
test paths:
2 marks if candidate gets all paths (or alternative paths) correct. 1 mark if candidate does not start with paths 1-6-7-9 or 1-6-8-9 but still gets the other paths correct. 0 marks if candidate does not start with paths 1-6-7-9 or 1-6-8-9 and uses other paths.
|
||||||||||
(b) | (i) A project group has implemented a power match-making system to pair up potential unmarried males and females. In this program, one of the criteria used to match-make a male participant to a female participant is the persons age. The variable AGE in this system has been declared as an integer data-type, and only participants from the ages of 22 to 45 are allowed to be match-made. Use the boundary value analysis testing method to propose six test cases that should be used in the testing of the AGE variable. | [3] | ||||||||
Choice of test
cases should be 21, 22, 23, 44, 45, 46. A maximum of 3 marks should be awarded if all six are correct. Deduct one mark for each error or omission (minimum 0 marks).
|
||||||||||
(ii) Explain your answer in your own words why this testing method is effective. | [2] | |||||||||
Rationale: Boundary
Value Analysis focuses testing on the limits of a data variable range (1 mark). Testing at
this limit is effective because a program is more likely to fail at the limits than
elsewhere (1 mark).
|
||||||||||
(c) | In the same match-making program as described in part (b), the gender of each participant is differentiated through the use of the SEX data variable. This data variable is one of the character type, with a length of one character. The possible values for the SEX data variable are M and F. | |||||||||
(i) Use the equivalence partitioning testing method to propose one valid and one invalid equivalence class of inputs. | [2] | |||||||||
Valid Class of
inputs: M or F (1 mark) Invalid Class of inputs: Any other Character (1 mark).
|
||||||||||
(ii) Propose one test-case each for the valid class and the invalid class. | [2] | |||||||||
Proposition of
test-cases for Valid Class: Either M or F is acceptable (1 mark). Proposition of test-cases for Invalid Class: Any other character that is not M or F is acceptable (1 mark).
|
||||||||||
(d) | The two testing methods used in validation testing are Alpha and Beta testing. List two differences between Alpha and Beta testing. | [4] | ||||||||
Possible differences are given
in the table below: any 2 correct differences should be awarded 2 marks each.
|