Documente Academic
Documente Profesional
Documente Cultură
Term:2009-2010
3 Nice Domains L3 28
4 Ugly Domains L4 42
5 Domain Testing L5 51
2
Domain Testing - Domains & Paths
Domain Testing Model
D1
D2
INPUT CLASSIFY DO CASE 1 OUTPUT
D3
(x,y,z,…) Dn { Outcome }
DO CASE 2
(1, 2, 3, 4, 5,…)
DO CASE 3
DO CASE n
Two Views
• Based on Specs
• Functional Testing
• Structural Technique
• Variables
• Simple combinations of two variables
• Numbers from - to +
• Loop-free Programs
• Specified by predicates
• Interpretation
MIN MAX
D1 D2 D3
Closed
MIN MAX
D1 D2 D3
Open
X > MIN X < MAX
• Slicing Boundary
• Double-zero representation
• Contradictory domains
undefined
ref boris beizer 16
Domain Testing - Domains & Paths – Bug Assumptions..
• Over-specified domains
X > 3 .AND. X < 2 .AND. Y > 3
• Boundary errors
Boundary closure
Shifted
• Boundary errors….
Tilted
Missing
Extra boundary
X >= 3
• Closure Reversal
• Faulty Logic
1. Coincidental Correctness
DT cannot detect
Example
F1(x) : +1
• Representative outcome D1
Partition testing
Input Equivalence D2
F2(x) : -1
Function f1
D1
INPUT CLASSIFY DO CASE 1 OUTPUT
(x, y, z, …) D2 { Outcome }
DO CASE 2
(1, 2, 3, 4, 5,…) f2
D3
DO CASE 3
f3
Dn
f4
DO CASE n
D1
X X >=0 .AND. X <= 16
0 16
D1
Y Y = 1 .AND. X >=0 .AND. X <= 16
0 16
X
• Impact of .OR.
• Concave, Disconnected
• Example
ABC + DEF
a x + b y >= c
• Polynomials
6. Loop-free Software
Definite loop
Nice Domains
Requirements
Before DT
• Analyze specs
Implemented Domains
Specified Domains
• Incomplete, Inconsistent
U1 U2
V1 D11 D12
V2 D21 D22
Nice Domains
Advantages
• Ease of DT
Nice Domains
Boundaries are
2. Complete
6. Convex
3. Systematic
n-dim Hyperplane:
n+1 Points
Non-Linear
• Transform
ref boris beizer 33
Domain Testing - Domains & Paths – Nice domains
2. Complete Boundaries
Incomplete…
• Reasons
• Tests
• Parallel lines
• Identical Sectors in a Circle
• DT
• Test a domain
ref borisTests
beizer for other Domains 35
Domain Testing - Domains & Paths - Nice domains
4. Orthogonal Boundaries
• Parallel to axes
Vj
• DT
• # Tests O (n)
• Rectangular coordinates
• Polar
r ≥ aj .AND. r < aj+1 .AND.
≥ j .AND. < j+1
ref boris beizer 37
Domain Testing - Domains & Paths - Nice domains
Non-Orthogonal Boundaries
• Example
D3 D1 D2 D4
• DT
• n on-points & 1 off-pt
Concave
D2
D1
• 2 complementary domains
• Programmer / Designer
• Convex part First
ref boris beizer 41
Domain Testing - Domains & Paths – Ugly Domains
Generally,
1. Non-linear Boundaries
• Transform
• Missing boundary
• Overlapping of
• Domain Specs
• Closure Specs
D3
D1 D2
• Complexity !
• Filling in Holes
Correct:
Generally,
• Interior point
• Exterior point
• Epsilon neighborhood
• Extreme point
• On point
Extreme
point
Boundary point
Epsilon neighborhood
On Points
Domain D1
ref boris beizer 53
Domain Testing - Domains & Paths – Domain Testing
1. 1-d Domains
2. 2-d Domains
4. Random Testing
B A B A
Closure Bug
x x
B A
Shift left Bug
x1 x
B A
Shift Right Bug
x x1
B A B A
Missing Boundary x
x x
Extra Boundary B A C
x x
x x1
• Closure bug
• Tilted Boundary
• Extra Boundary
• Missing Boundary
a
A
c c’
c
d
B
To avoid bugs
• Independent testing
ref boris beizer 61
Domain Testing - Domains & Paths – Domain Testing L5
Procedure
Effectiveness
• Cost effective
• Domain
• Range
Variable
Range for Domain for Range for
Routine 1 Routine 2
Domain Routine1 Routine2 Routine2
• Span compatibility
• Linearizing transformations
• Polynomial
• Rectangular to polar
• Generic & rational => Taylor series
• Co-ordinate transformations