Professional Documents
Culture Documents
Defect Testing: Testing Programs To Establish The Presence of System Defects
Defect Testing: Testing Programs To Establish The Presence of System Defects
Slide 1
Objectives
l
l
l
Slide 2
Topics covered
l
l
l
l
Defect testing
Integration testing
Object-oriented testing
Testing workbenches
Slide 3
Component testing
Integration testing
Slide 4
Testing phases
Component
testing
Integration
testing
Software developer
Slide 5
Defect testing
l
Slide 6
Testing priorities
l
Slide 7
Slide 8
Test
cases
Design test
cases
Test
data
Prepare test
data
Test
results
Run program
with test data
Test
reports
Compare results
to test cases
Slide 9
Black-box testing
l
Slide 10
Black-box testing
Input test data
Inputs causing
anomalous
behaviour
System
Oe
Slide 11
Equivalence partitioning
l
Slide 12
Equivalence partitioning
Invalid inputs
Valid inputs
System
Outputs
Slide 13
Equivalence partitioning
l
Slide 14
Equivalence partitions
3
4
Less than 4
11
10
Between 4 and 10
More than 10
50000
100000
99999
Input values
Ian Sommerville 2000
Slide 15
Slide 16
Slide 17
l
l
Slide 18
Element
In sequence
Not in sequence
First element in sequence
Last element in sequence
Middle element in sequence
Not in sequence
Key (Key)
17
0
17
45
23
25
Output (Found, L)
true, 1
false, ??
true, 1
true, 7
true, 4
false, ??
Slide 19
Structural testing
l
l
Slide 20
White-box testing
Test data
Tests
Derives
Component
code
Test
outputs
Slide 21
class BinSearch {
// This is an encapsulation of a binary search function that takes an array of
// ordered objects and a key and returns an object with 2 attributes namely
// index - the value of the array index
// found - a boolean indicating whether or not the key is in the array
// An object is returned because it is not possible in Java to pass basic types by
// reference to a function and so return two values
// the key is -1 if the element is not found
public static void search ( int key, int [] elemArray, Result r )
{
int bottom = 0 ;
int top = elemArray.length - 1 ;
int mid ;
r.found = false ; r.index = -1 ;
while ( bottom <= top )
{
mid = (top + bottom) / 2 ;
if (elemArray [mid] == key)
{
r.index = mid ;
r.found = true ;
return ;
} // if part
else
{
if (elemArray [mid] < key)
bottom = mid + 1 ;
else
top = mid - 1 ;
}
} //while loop
} // search
} //BinSearch
l
l
l
l
l
Slide 23
Mid-point
Slide 24
Key (Key)
17
0
17
45
23
21
23
25
Output (Found, L)
true, 1
false, ??
true, 1
true, 7
true, 4
true, 3
true, 4
false, ??
Slide 25
Path testing
l
Slide 26
Slide 27
Cyclomatic complexity
l
Slide 28
8
5
9
7
Independent paths
l
l
l
l
l
1, 2, 3, 8, 9
1, 2, 3, 4, 6, 7, 2
1, 2, 3, 4, 5, 7, 2
1, 2, 3, 4, 6, 7, 2, 8, 9
Test cases should be derived so that all of these
paths are executed
A dynamic program analyser may be used to
check that paths have been executed
Slide 30
Integration testing
l
l
l
Slide 31
T1
T1
A
T1
T2
T2
T2
T3
T3
C
T4
T3
C
T4
T5
D
Test sequence
1
Ian Sommerville 2000
Test sequence
2
Software Engineering, 6th edition. Chapter 20
Test sequence
3
Slide 32
Top-down testing
Bottom-up testing
Slide 33
Top-down testing
Level 1
Testing
sequence
Level 2
Level 1
Level 2
Level 2
...
Level 2
Level 2
stubs
Level 3
stubs
Slide 34
Bottom-up testing
Test
drivers
Level N
Test
drivers
Level N
Level N1
Level N
Level N1
Level N
Level N
Testing
sequence
Level N1
Slide 35
Tetsing approaches
l
Architectural validation
System demonstration
Test implementation
Test observation
Slide 36
Interface testing
l
Slide 37
Interface testing
Test
cases
Slide 38
Interfaces types
l
Parameter interfaces
Procedural interfaces
Slide 39
Interface errors
l
Interface misuse
Interface misunderstanding
Timing errors
Slide 40
l
l
l
l
Slide 41
Stress testing
l
Slide 42
Object-oriented testing
l
Slide 43
Testing levels
l
l
l
l
Slide 44
Slide 45
identifier
reportWeather ()
calibrate (instruments)
test ()
startup (instruments)
shutdown (instruments)
Slide 46
Object integration
l
Slide 47
Thread testing
Slide 48
Scenario-based testing
l
Slide 49
:WeatherStation
:WeatherData
request (report)
acknowledge ()
report ()
summarise ()
send (report)
reply (report)
acknowledge ()
Slide 50
CommsController:request
WeatherData:summarise
WeatherStation:report
Slide 51
Testing workbenches
l
Slide 52
A testing workbench
Test data
generator
Specification
Test
manager
Test data
Oracle
Dynamic
analyser
Program
being tested
Test
results
Test
predictions
Execution
report
Simulator
Source
code
File
comparator
Report
generator
Ian Sommerville 2000
Test results
report
Slide 53
Slide 54
Key points
l
Slide 55
Key points
l
Slide 56