0% found this document useful (0 votes)
198 views

CSCI926 Final Exam Autumn 2022

This document contains instructions and 6 questions for a 3-hour software testing and analysis examination. It provides directions for submitting answers, acknowledges that work must be completed independently, and notes that plagiarism may result in failure. The 6 questions address topics like random testing, test case design using category-partitioning, symbolic execution, data dependency graphs, test criteria for functions and state machines.

Uploaded by

Minh Tran
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
198 views

CSCI926 Final Exam Autumn 2022

This document contains instructions and 6 questions for a 3-hour software testing and analysis examination. It provides directions for submitting answers, acknowledges that work must be completed independently, and notes that plagiarism may result in failure. The 6 questions address topics like random testing, test case design using category-partitioning, symbolic execution, data dependency graphs, test criteria for functions and state machines.

Uploaded by

Minh Tran
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

School of Computing and Information Technology

Student to complete:
Family name
Other names
Student number

CSCI926
Software Testing and Analysis
South Western Sydney and Wollongong

Examination Paper
Autumn 2022

Exam duration 3 hours + 15 minutes for scanning and uploading answers

Weighting 55 %

Directions to students This paper includes 6 questions.

Submit your work in one single file (PDF or Word) to the Exam
Submission site provided on Moodle.

To draw diagrams, you can use any tool of your choice (or draw
by hand and take pictures – make sure the pictures are all
clear). However, you need to insert the diagrams back into the
submission file.

Submission must be made by the exam end time. Late


submission is not accepted. The submission site will
automatically be closed after the exam end time.

The exam must be completed independently on your own. You


must not discuss, collude, or share you work with anyone else.

When you submit, you acknowledge that it is your own work.


Plagiarism and other academic misconducts may result in a Fail
grade and are subject to the University Academic Misconduct
Procedures.

CSCI926 Autumn 2022 Page 1 of 4


Question 1 (12 marks)

1) Suppose that program prog(x, y, z) accepts three parameters x, y, and z, each of


which is a one-byte (8-bit) unsigned integer (that is, a nonnegative integer). The
program prog is supposed to calculate and then print the value of x+y-z. However,
there is a fault in the program such that when the input is (x=50, y=10, z=1), the
output of prog is 100. Suppose that for all other input values, the output of prog is
correct.

If random testing is performed, what is the probability of discovering this fault?


Explain your answer.
(3 marks)

2) Define a test obligation for program prog above, and a test suite which satisfies
this test obligation.
(3 marks)

3) Assume that the context is testing self-driving cars. For each of the FOUR
dependability qualities discussed in this subject, provide an example to explain its
meaning and the relation among those dependability qualities in this specific
context. Your examples must be specific to this case study. Generic answers will
receive 0 marks.
(6 marks)

Question 2 (15 marks)

Consider the system testing of an online shopping system. Design test case
specifications using the category-partition method as follows:
a) Identify an independently testable feature.
b) Identify at least 3 parameters/environment elements; for each parameter or
environment element, identify at least 3 categories.
c) For each category, identify at least 2 choices (that is, classes of values).
d) Introduce at least 1 error constraint, 1 property constraint and 1 single
constraint.
e) Give complete test case specifications.

Question 3 (10 marks)

Demonstrate how symbolic execution is applied for the following program. Identify
feasible and infeasible paths. For each feasible path, provide a representative test
case.

public void solve(double a, double b, double c, double d){

if (a == 0.0) {
return;
}

double denom = a;
a = b/denom;

CSCI926 Autumn 2022 Page 2 of 4


b = c/denom;
c = d/denom;

double v = a + b + c;

if (v < 0.0) {
System.out.prinltn(“Three unequal real roots.”
if (denom == 0.0) {
System.out.println(“Invalid”);
}
else {
System.out.println(“Valid”);
}
}
else if (v > 0.0){
System.out.prinltn(“One real root.”);
}
else {
System.out.println("At least two equal.”);

Question 4 (6 marks)

Draw a data dependency graph for the program.

void simple(int a, int b, int c, int d){


int i, j, k, m;

m = 20;
k = 2;
i = b + a;
j = d;
k = k + 5;

while ((c + d ) > i) {


i = i+2;
j = i + c – d + a;

if (j > i + 5){
k = j + i;
}

return;
}

CSCI926 Autumn 2022 Page 3 of 4


Question 5 (6 marks)

Design a minimal set of test cases for the function simple() in Question 4. Your test
suite must meet the loop boundary adequacy criterion and branch coverage criterion
(note: give test cases rather than test case specifications).

Which of the two criteria subsume the other? Explain your answer.

Question 6 (6 marks)

Consider the finite state machine which models a sound recording software as
below.

off

stop Stopped stop

record rewind
play stop

Recording Playing Rewinding

off
off off

1) Derive a test suite that satisfies the transition coverage criterion.

2) Derive another test suite that satisfies the state-pair coverage criterion.

** End of Examination **

CSCI926 Autumn 2022 Page 4 of 4

You might also like