1
Software Testing
Dr. R. Mall
2
Organization of this
Lecture:
Review of last lecture.
Data flow testing
Mutation testing
Cause effect graphing
Performance testing.
Test summary report
Summary
3
Review of last lecture
White box testing:
4
Review of last lecture
We discussed a few white-box test
strategies.
5
Data Flow-Based Testing
Selects test paths of a program:
6
Data Flow-Based Testing
For a statement numbered S,
Example: 1: a=b; DEF(1)={a},
USES(1)={b}.
Example: 2: a=a+b; DEF(1)={a},
USES(1)={a,b}.
7
Data Flow-Based Testing
A variable X is said to be live at statement S1,
if
8
DU Chain Example
1
X(){
2
a=5; /* Defines variable a
*/
3
While(C1)
{
4 if
(C2)
5
b=a*a; /*Uses variable
a */
6
a=a-1; /* Defines variable a */
7 }
8 print(a); } /*Uses variable a */
9
Definition-use chain (DU
chain)
[X,S,S1],
S and S1 are statement numbers,
10
Data Flow-Based Testing
One simple data flow testing strategy:
11
Data Flow-Based Testing
Data flow testing
strategies:
12
Data Flow-Based Testing
13
Data Flow-Based Testing
[a,1,5]: a DU chain.
Assume:
DEF(X) = {B1, B2, B3, B4, B5}
USED(X) = {B2, B3, B4, B5, B6}
However only 5 paths are needed to cover these
chains.
14
Mutation Testing
The software is first tested:
After the initial testing is
complete,
The idea behind mutation testing:
15
Mutation Testing
Each time the program is changed,
16
Mutation Testing
A mutated program:
If there exists at least one test case in the test
suite for which:
a mutant gives an incorrect result,
17
Mutation Testing
If a mutant remains alive:
even after all test cases have been exhausted,
The process of generation and killing of mutants:
18
Mutation Testing
The primitive changes can be:
altering an arithmetic operator,
changing the value of a constant,
changing a data type, etc.
19
Mutation Testing
A major disadvantage of mutation testing:
computationally very expensive,
20
Cause and Effect Graphs
Testing would be a lot
easier:
Work done at IBM:
21
Cause and Effect Graphs
Examine the requirements:
22
Cause and Effect Graphs
Convert the graph to a decision table:
23
Steps to create cause-effect
graph
Study the functional requirements.
Mark and number all causes and effects.
Numbered causes and effects:
24
Steps to create cause-effect
graph
Draw causes on the LHS
Draw effects on the RHS
Draw logical relationship between causes and effects
Extra nodes can be added
25
Drawing Cause-Effect
Graphs
A
B
If A then B
A
B
If (A and B)then C
C
26
Drawing Cause-Effect
Graphs
A
B
If (A or B)then C
C
A
B
If (not(A and B))then C
C
27
Drawing Cause-Effect
Graphs
A
B
If (not (A or B))then C
C
A
B
If (not A) then B
28
Cause effect graph-
Example
A water level monitoring system
29
Cause effect graph-
Example
Processing
The function calculates whether the level is safe,
too high, or too low.
Output
30
Cause effect graph-
Example
We can separate the requirements into 5
clauses:
31
Cause effect graph-
Example
Parameters A and B are real numbers:
The parameters A and B are real numbers:
32
Cause effect graph-
Example
33
Cause effect graph-
Example
Three effects
34
Cause effect graph-
Example
10
E3
11
E1
E2
1
2
3
4
5
35
Cause effect graph- Decision
table
Cause 1
Cause 2
Cause 3
Cause 4
Cause 5
Effect 1
Effect 2
Effect 3
Test 1
Test 2
Test 3
Test 4
Test 5
I
I
I
I
I
I
I
S
I
X
S
S
S
S
S
P
P
S
I
S
A
A
A
A
A
P
P
P
A
A
A
A
A
X
X
X
X
X
X
I
36
Cause effect graph-
Example
Put a row in the decision table for each cause or
effect:
in the example, there are five rows for causes and
three for effects.
37
Cause effect graph-
Example
The columns of the decision table correspond to test
cases.
Define the columns by examining each
effect:
38
Cause effect graph-
Example
We can determine the number of columns of the
decision table
39
Cause effect graph-
Example
Theoretically we could have generated 25=32 test
cases.
40
Cause effect graph
Not practical for systems which:
41
Testing
Unit testing:
Integration testing:
System testing:
42
Integration testing
After different modules of a system have been coded
and unit tested:
43
System Testing
System testing:
44
Integration Testing
Develop the integration plan by examining the
structure chart :
45
Example Structured
Design
root
Get-good-data
Compute-solution
Display-solution
Get-data
Validate-data
Valid-numbers
Valid-numbers
rms
rms
46
Big bang Integration Testing
Big bang approach is the simplest
integration testing approach:
47
Big bang Integration Testing
Main problems with this approach:
48
Bottom-up Integration Testing
Integrate and test the bottom level modules first.
A disadvantage of bottom-up testing:
49
Top-down integration testing
Top-down integration testing starts with the main
routine:
After the top-level 'skeleton’ has been
tested:
50
Mixed integration testing
Mixed (or sandwiched) integration testing:
51
Integration Testing
In top-down approach:
In bottom-up approach:
52
Phased versus Incremental Integration Testing
Integration can be incremental or phased.
In incremental integration testing,
53
Phased versus Incremental Integration Testing
In phased integration,
Big-bang testing:
54
Phased versus Incremental Integration Testing
Phased integration requires less number of
integration steps:
However, when failures are detected,
55
System Testing
System tests are designed to validate a fully
developed system:
56
System Testing
There are essentially three main kinds of system testing:
57
Alpha testing
System testing is carried out
58
Beta Testing
Beta testing is the system testing:
59
Acceptance Testing
Acceptance testing is the system testing performed by the
customer
60
System Testing
During system testing, in addition to
functional tests:
61
Performance Testing
Addresses non-functional requirements.
62
Stress testing
Evaluates system performance
Stress testing
63
Stress testing
Stress tests are black box tests:
64
Stress Testing
If the requirements is to handle a specified number
of users, or devices:
65
Stress Testing
If an operating system is supposed to support 15
multiprogrammed jobs,
A real-time system might be tested
66
Stress Testing
Stress testing usually involves an
element of time or size,
such as the number of records transferred per unit
time,
the maximum number of users active at any time,
input data size, etc.
Therefore stress testing may not be
applicable to many types of systems.
67
Volume Testing
Addresses handling large amounts of data in the
system:
whether data structures (e.g. queues, stacks,
arrays, etc.) are large enough to handle all possible situations
Fields, records, and files are
stressed to check if their size can accommodate all possible data
volumes.
68
Configuration Testing
Analyze system behavior:
for instance, a minimal system may serve a single
user,
69
Compatibility Testing
These tests are needed when the system interfaces
with other systems:
70
Compatibility testing
Example
If a system is to communicate with a large database
system to retrieve information:
71
Recovery Testing
These tests check response to:
presence of faults or to the loss of data, power,
devices, or services
72
Maintenance Testing
Diagnostic tools and procedures:
73
Maintenance Testing
Verify that:
74
Documentation tests
Check that required documents exist and are
consistent:
75
Documentation tests
Sometimes requirements specify:
76
Usability tests
All aspects of user interfaces are
tested:
77
Environmental test
These tests check the system’s ability to perform at
the installation site.
Requirements might include tolerance for
disruption of power, etc.
78
Test Summary Report
Generated towards the end of testing phase.
Covers each subsystem:
79
Test Summary Report
Specifies:
how many tests have been applied to a subsystem,
how many tests have been successful,
how many have been unsuccessful, and the degree to
which they have been unsuccessful,
80
Regression Testing
Does not belong to either unit test, integration
test, or system test.
In stead, it is a separate dimension to these
three forms of testing.
81
Regression testing
Regression testing is the running of
test suite:
82
Regression testing
Regression tests assure:
83
Summary
We discussed two additional white box testing
methodologies:
84
Summary
Data flow testing:
Mutation testing:
if not, augment test suite
85
Summary
Cause-effect graphing:
86
Summary
Integration testing:
87
Summary: System testing
Functional test
Performance test