Testing
Testing
Testing
What is testing?
Why test?
How testing increase our confidence in program correctness?
When to test?
Functional testing
What to test?
How to test?
Different types of testing
How to assess test adequacy?
activities
Error revealing
Inputs
inputs cause failures
Functional testing
Program
Erroneous outputs
Outputs indicate failures
Types of reviews
Walkthroughs
Inspections
TEAM
Stage 1 - Overview
Overview document (specs/design/code/ plan) to be prepared by
person responsible for producing the product.
Document is distributed to participants.
Team
Moderator-manager, leader of inspection team
Designer - team responsible for current phase
Implementer - team responsible for next phase
Tester - preferably from SQA team
modules
Too many faults => redesign the module
Information on fault types will help in code inspection in the same
module
test.
Assumed:
The input sequence contains N integers.
The output area has space for at least N integers.
Example post-condition:
if user places cursor on the name field then read a string
Functional testing
This post-condition does not specify any limit on the length of the
input string hence is incomplete.
specification!
2
1
3
task T2.
X<0 X>=0
Equivalence class Another test case:
X=-15
X<Y, Z<=Y
X=2, Y=3, Z=1
X>=Y, Z<=Y
X<Y X=15, Y=4, Z=1
Functional testing
X>=Y, Z>Y
X=15, Y=4, Z=7
However, we may also select only 2 test inputs and satisfy all four
equivalence classes:
X=4, Y=7, Z=1 satisfies X<Y and Z<=Y
X=4, Y=2, Z=3 satisfies X>=Y and Z>Y
Thus, we have reduced the number of test cases from 4 to 2 while
Functional testing
In the previous two examples the inputs were integers. One can
derive equivalence classes for other types of data also.
Example 3:
Suppose that program P takes one character X and one string Y as
inputs. P performs task T1 for all lower case characters and T2 for
Functional testing
upper case characters. Also, it performs task T3 for the null string
and T4 for all other strings.
X:UC
X: lc, Y: null
Y: null Y: not null
Input condition specifies a range: create one for the valid case and two for
the invalid cases.
e.g. for a<=X<=b the classes are
a<=X<=b (valid case)
X<a and X>b (the invalid cases)
Functional testing
Input condition specifies a value: create one for the valid value and
two for incorrect values (below and above the valid value). This may
not be possible for certain data types, e.g. for boolean.
Input condition specifies a member of a set: create one for the valid
value and one for the invalid (not in the set) value.
Functional testing
classes contains only one value (X=0), the other two are large!
14
1 5 2
y2
10
11
8 9 6
13
y1 12 3
4 7
x1 x2
August 26, 2010 55
BVA-continued
In this case the four sides of the rectangle represent the boundary.
The heuristic for test selection in this case is:
Select one test at each corner (1, 2, 3, 4).
Select one test just outside of each of the four sides of the
Functional testing
boundary (5, 6, 7, 8)