Professional Documents
Culture Documents
EXTERNAL
Semester One, 2017
Duration 3 hours
Type of Exam Closed Book Exam – text, unit guide or reader not
permitted
Page 1 of 20
SECTION A – ANSWER ALL QUESTIONS
(All questions are worth 5 marks)
Question 1 (5 Marks)
This question has 10 parts. There are FIVE choices (A, B, C, D and E) associated with each
part. Put a circle around ONE of these letters to indicate your selection.
(i) Postal rates for letters are 50 cents up to 10 grams, 75 cents up to 50 grams
plus an extra 20 cents for each additional 25 grams up to 100 grams.
Which test inputs (in grams) would be selected using equivalence partitioning?
(ii) Which is the following statement(s) could be used to assess coverage achieved
for white-box testing?
A. I, II, III
B. II, III
C. I, IV, V
D. III
E. I, II, V
(iii) If test cases are derived from looking at the code, what type of test design
technique is being used?
A. Black box
B. White box
C. Specification-based
D. Behaviour-based
E. both A and C
A. A minimal test set that achieves 100% path coverage will also achieve 100%
statement coverage.
B. A minimal test set that achieves 100% path coverage will generally detect more
faults than one that achieves 100% statement coverage.
Page 2 of 20
C. A minimal test set that achieves 100% statement coverage will generally detect
more faults than one that achieves 100% branch coverage.
D. A minimal test set that achieves 100% path coverage will generally detect more
faults than one that achieves 100% branch coverage.
E. A minimal test set that achieves 100% path coverage will generally detect more
faults than one that achieves 100% condition coverage.
(v) For the control graph shown below, three tests have been run:
Assume each box in the control flow graph corresponds to a statement. What is the
statement coverage of these three tests?
A. 60%
B. 50%
C. 70%
D. 80%
E. 90%
A. Model-based testing.
B. Object-Oriented testing
C. No single testing technique
Page 3 of 20
D. Black –box testing
E. White-box testing
viii) Combinatorial testing is testing technique where the criteria used to design test
cases is that they
A. I, V
B. I, II, III
C. I, IV, V
D. II, III, IV
E. I, II
A. I, II, IV
B. II, IV
C. I, III, V
D. II, III
E. I, III
Page 4 of 20
Question 2 ( 8 Marks)
2) (i) Define what is a test case. Give actual examples to illustrate. (2 marks)
(ii) Describe, and give examples to illustrate, the difference between a test requirement
and a test case (1 mark)
(2 marks)
Page 5 of 20
Question 2 (Continued)
Page 6 of 20
ADDITIONAL PAGE FOR QUESTION 2
Page 7 of 20
Question 3 (10 Marks)
(a) Describe your understanding of data flow testing. Using an example, make sure that
you discuss: def-use; definition clear paths, simple paths, loop free path segments and
different data coverage criteria
(5 marks)
Page 8 of 20
Question 3 (Continued)
i. Draw the Control Flow Graph for the code segment given below.
ii. List all the def-use pairs for the code segment below.
iii. Give Provide a test suite for this code segment which will satisfy each of the
following test coverage criteria below (i.e. one for each criterion):
a) All-defs coverage
b) All-uses coverage
c) All-du-path coverage
1. input(X,Y)
2. while (Y>0) {
3. if (X>0)
4. Y := Y-X
else
5. input(X)
6. }
7. output(X,Y)
Page 9 of 20
ADDITIONAL PAGE FOR QUESTION 3
Page 10 of 20
Question 4 (9 Marks)
(i) Discuss how characteristics of object-oriented software will affect how we test such
software systems. Provide examples to demonstrate where appropriate. (3 Marks)
(ii) What is model-based testing? List models that can be used in testing and discuss the
advantages and disadvantages of model-based testing. (3 Marks)
Page 11 of 20
(iii) Describe your understanding of GUI testing; highlighting differences from non-GUI
based testing, difficulties and approaches that can be used in GUI testing (3Marks)
Page 12 of 20
Question 5 ( 9 Marks)
(a) Given the code above, with basic blocks marked and labeled (from A to I) above, (5
Marks)
(i) Draw the Control Flow Graph for the code segment.
Page 13 of 20
Question 5 (Continued)
(ii) List the set of basis path that will cover this CFG.
(iii) Derive your test cases using the basic path set from (ii).
(b) (4 marks)
(i) Outline your understanding of Junit, highlighting some of its key concepts that
you have used.
Page 14 of 20
Question 5 (Continued)
(ii) What is Selenium, how does it work? List its different software components.
Which types of tests can be done using Selenium?
Page 15 of 20
Question 6 ( 9 Marks)
The software program accepts a 6 digit number and 3 real numbers (A, B, C) as
input. The 6 digit number is the student ID. (e.g. 111222). The 3 real numbers are
the marks for assessment items for a first year unit. The total mark for the unit is
obtained by adding the three marks. The range for A and B is 0 and 20 inclusive.
The range for C is 0 and 60 inclusive. The total mark is in the range of 0
(minimum) to 100 (maximum) marks. The program outputs the grade associated
with the total mark. If the total mark is <=50, the program outputs “F”, if the total
mark is >= 50, “P ” is the output.
(i) How many test cases is required for Strong Equivalence Class Testing?
(ii) How many test cases is required for Weak Equivalence Class Testing?
(iii) List the set of test cases for Weak Equivalence Class Testing?
(5 marks)
Page 16 of 20
Question 6 (Continued)
Using the information in Table 1, develop a suite of test cases that will meet the
following coverage: (4 marks)
i. All combinations
ii. Each choice
iii. pair-wise
iv. Base Choice
Page 17 of 20
ADDITIONAL PAGE FOR ANY QUESTIONS THAT YOU MAY NEED
Page 18 of 20
ADDITIONAL PAGE FOR ANY QUESTIONS THAT YOU MAY NEED
Page 19 of 20
DO NOT TURN THIS PAPER OVER UNTIL
INSTRUCTED TO DO SO
Page 20 of 20