Unit 5
Unit 5
Unit 5
a) Operability:- If a system is designed and implemented with quality in mind, relatively few bugs will block the
execution of tests.
b) Observability:- “What you see is what you test.” Inputs provided as part of testing produce distinct outputs.
c) Controllability:- “The better we can control the software, the more the testing can be automated and optimized.”
All possible outputs can be generated through some combination of input.
d) Decomposability:- By controlling the scope of testing, we can more quickly isolate problems and perform smarter
retesting.
e) Simplicity:- “The less there is to test, the more quickly we can test it.” The program should exhibit functional
simplicity; structural simplicity, and code simplicity.
f) Stability:- “The fewer the changes, the fewer the disruptions to testing.”
g) Understandability:- “The more information we have, the smarter we will test.”
(1) Knowing the specified function that a product has been designed to perform, tests can be conducted that
demonstrate each function is fully operational while at the same time searching for errors in each function.
(2) Knowing the internal workings of a product, that is, internal operations are performed according to
specifications and all internal components have been adequately exercised.
The first test approach takes an external view and is called black-box testing. A black-box test examines some
fundamental aspect of a system with little regard for the internal logical structure of the software.
White-box testing, sometimes called glass-box testing. Using white-box testing methods, you can derive test cases
that
(1) Guarantee that all independent paths within a module have been exercised at least once,
(2) Exercise all logical decisions on their true and false sides.
(3) Execute all loops at their boundaries and within their operational bounds, and
Basis path testing is a white-box testing technique. Test cases derived to exercise the basis set are guaranteed to
execute every statement in the program at least one time during testing.
The flow graph depicts logical control flow using the notation illustrated in Figure 18.1.
An independent path is any path through the program that introduces at least one new set of processing statements
or a new condition. For example, a set of independent paths for the flow graph illustrated in Figure 18.2b is
Path 1: 1-11
Path 2: 1-2-3-4-5-10-1-11
Path 3: 1-2-3-6-8-9-10-1-11
Path 4: 1-2-3-6-7-9-10-1-11
How do you know how many paths to look for? The computation of cyclomatic complexity provides the
answer. Cyclomatic complexity is a software metric. the value computed for cyclomatic complexity defines the
number of independent paths in the basis set of a program. Complexity is computed in one of three ways:
1. The number of regions of the flow graph corresponds to the cyclomatic complexity.
V(G) = E - N + 2
where E is the number of flow graph edges and N is the number of flow graph nodes.
V(G) = P + 1
Referring once more to the flow graph in Figure 18.2b, the cyclomatic complexity can be computed using each
of the algorithms just noted:
A data structure, called a graph matrix, can be quite useful for developing a software tool that assists in basis path
testing.
A graph matrix is a square matrix whose size (i.e., number of rows and columns) is equal to the number of nodes
on the flow graph. Each row and column corresponds to an identified node, and matrix entries correspond to
connections (an edge) between nodes.
Referring to the figure, each node on the flow graph is identified by numbers, while each edge is identified by
letters. A letter entry is made in the matrix to correspond to a connection between two nodes. For example, node
3 is connected to node 4 by edge b.
The link weight provides additional information about control flow. In its simplest form, the link weight is 1 (a
connection exists) or 0 (a connection does not exist).
See the slides (104-154) chapter 8 Software testing by KK Aggarwal for further numerical examples of
white Box testing.