You are on page 1of 9

CSC3056 – 2021/22

1. Analysing software dependability threats: errors, fault, failure


[10 marks]

Consider the following real defect (bug) report from the issue tracker of the Google
Chrome browser:

In this example defect, identify the fundamental threats of software dependability


(errors, fault, and failure), by visualizing them into a causation graph similar to the
one provided below. If there could be several of these threats, mention those several
possibilities directly inside the graph, like the one below.
CSC3056 – 2021/22

2. Black-box testing of a software feature


[25 total marks, three parts: a, b, c]

We want you to develop a want to develop a black-box (functional) test suite to test
the “Send Message” feature (use-case) of the Facebook Messenger. Many other
communication software tools (such as WhatsApp, Imo, etc.) have a very similar
feature. See the screenshot below to recall how this feature works (Note: the person
names below are all made-up). Some important feature specifications:

 The type of each message can be: text only, photo with text, photo without
text, voice message only, thumbs up only
 When the “thumbs up” is pressed, a single message with that content will be
sent, and cannot be combined with other contents, such as text or photo
 Any number of Emoji’s can be included in side a text message
 For simplicity, let us assume that a chat-session can only be between two
users, and the system does not allow group chats among more than two
users.

Screen: List of Screen: Chat window


friends/contacts
CSC3056 – 2021/22

 If you think you should made any additional assumptions / additions to the
provided specifications above, feel free to do so, by stating your
assumption(s) / additional specifications in your exam paper.

(a) Reasoning for choosing a “suitable” black-box test-case design technique

[5 marks]

Using a valid reasoning (in a few sentences), choose an appropriate black-box test-
case design method from among all different black-box test-case design techniques
that we have learned in our module, e.g., cause-effect graph, equivalence class,
decision table, model-based testing, etc.

Provide (write) a reasoning of why you decide to choose that specific black-box test-
case design method from among all different methods, to apply to this particular
problem.

Hint: You need to relate your reasoning to the nature of this system, the feature
above, and its specifications.

(b) Details of how the black-box technique is applied

[10 marks]

Using the black-box test-case design method technique that you chose in part (a)
above, derive the set of test cases for the above feature. Show the details of your
solution.

The test cases of your final test suite should be listed in a classical test-case table,
as shown below.

Note: If the number of test cases (TCs) are more than 10, you need to write only 10
of those TCs in the table below, but ensure that you mention the total number of test
cases, and that it should be clear from your test cases how to derive the rest of test
cases, if we want to.

(c) Test suite and its correctness


CSC3056 – 2021/22

[10 marks]

TC (Test case) # Input(s) Expected output(s)


and/or behavior


CSC3056 – 2021/22

3. Black-box testing of a function


[25 total marks, three parts: a, b, c]

Let us consider the following method (function) of the class Range in the
JFreeChart API library that you have experience testing in some of your labs in the
module. We provide its API (Application Programming Interface) specification below:

For example, if the “this” object, on which we will call the function, is range1=[-2,
5], and if we call the method (function) as: range1.intersects(4, 23), the
method should return True. But if we call it as: range1.intersects(-15, -7),
the method should return False.

For any invalid input, we expect that the method shall raise (throw) the
IllegalArgumentException.

(a) Reasoning for choose a “suitable” black-box test-case design technique

[5 marks]

Provide a reasoning (in a few sentences) for choosing an appropriate black-box test-
case design method from among all different black-box test-case design techniques
that we have learned in our module, e.g., cause-effect graph, equivalence class,
decision table, model-based testing, etc.

Provide (write) a reasoning of why you want to choose that specific black-box test-
case design method from among all different methods, to apply to this particular
problem.

Hint: You need to relate your reasoning to the nature of this system, the feature
above, and its specifications.

(b) Details of how the black-box technique is applied


CSC3056 – 2021/22

[10 marks]

Using the black-box test-case design method technique that you chose in part (a)
above, derive the set of test cases for the above feature. Show the details of your
solution.

Notes:

 To analyse the problem and present your solution for grouping different
possibilities of a range or two ranges with respect to each other, you need to
visualize range instances as follows, in your presented solution:

 If you think you should made any additional assumptions / additions to the
provided specifications above, feel free to do so, by stating your
assumption(s) / additional specifications in your exam paper.

(c) Deriving the final test suite from the black-box technique in the previous step

The test cases of your final test suite should be listed in a classical test-case table,
as shown below.

Note: If the number of test cases are too many (more than 10), you can write
maximum 10 in the table below, but ensure that you mention the total number of test
cases, and that it should be clear from your test cases how to derive the rest of test
cases, if we want to.

[10 marks]

TC (Test case) # Input(s) Expected output(s)


and/or behavior


CSC3056 – 2021/22

4. White-box testing of a function


[40 total marks, four parts: a, b, c, d]

From the code-base of the JFreeChart software library, the source-code and
Javadoc specification of a function of the Range class is provided below. The first
15 commented lines are the Javadoc specification of the function.

Code line numbers are provided below, and you should refer to them in your
solution.

We want you to apply data-flow coverage to the above function, to derive a white-
box test suite for the function.

(a) Draw the Control Flow Graph (CFG) for the above function

[15 marks]

You need to first identify the code “blocks” in the above code (function), and then
draw the Control Flow Graph (CFG) for it. To do that, you need to fill out the
following table. Add more rows to the table as needed.

Notes: A block of code is a sequence of one or several lines of code, in which the
control flow does not change. Furthermore, you should pay special attention to if/else
and loops when identifying the code blocks, as we learned in the lectures.
CSC3056 – 2021/22

Line(s) of the code Assigned code


block number

 Reminder from lectures: based on the role of each code line in the above
given code, the code line shall or shall not appear in the above table.
 Then, use the data from the above table to draw the CFG.
 Assign block (node) numbers to the nodes of your CFG.

(b) Compute defs (variable “definitions”), c-uses (computational variable usages) and
p-uses (predicate variable usages) in each node/block of the CFG. Fill that information
in the following table.

[10 marks]

Node of CFG Def’s of variables c-uses p-uses

(c) Derive the c-use and p-use coverage domain by completing the following table.

[5 marks]

Notes:

 dcu = Definition-clear c-use path


 dpu = Definition-clear p-use path

Variable (v) Defined in node dcu(v, n) dpu(v, n)


(n)


CSC3056 – 2021/22

(d)-Based on the previous table, derive a white-box test suite to achieve full all-uses
coverage. To specify a range, use the following notation: r=[lower_bound,
upper_bound], such as: r1=[4, 9], r2=[-5, 21].

[10 marks]

Important: you need to clearly provide traceability links between the test cases and
test requirements (the c-use and p-use coverage domain) that you have in the
previous parts. In other words, it should be clear what c-use(s) and p-use(s) each
test cases covers, and that information shall be mentioned in the last column of the
table below.

Hint: in the last column below:

 to specify which dcu has been covered by the test case in each row of the
table, use the following notation: dcu(variable, def node, c-use node). For
example: dcu(range1, 1, 4) means that the variable range1 has been defined
in the current table row (node 1 in this example) and c-used in node 4 of the
CFG. Note that this example is made up, and not necessarily part of the
actual solution.
 to specify which dpu has been covered by the test case in each row of the
table, use the following notation: dpu(variable, CFG edge taken by p-use). For
example: dpu(range1, (1, 2)) means that the variable range1 has been
defined in the current table row and p-used in the edge (1, 2), i.e., going from
node 1 to node 2 of the CFG. Note that this example is made up, and not
necessarily part of the actual solution.

Test case Inputs Variables Expected output c-use(s) and p-


# use(s) covered
by the test case

You might also like