Professional Documents
Culture Documents
• Domain Testing
• Domains
• Model, as a set, paths
• Predicates
• closure, dimensionality, assumptions
• Nice & ugly domains
• specified & implemented domains
• Nice domains – properties, testing implications
• Ugly domains, simplification by programmers & testers
• Domain testing
• Bugs & testing for those bugs
• Testing procedure
• Variations, tools, effectiveness
• Domains & Interface Testing
• Range, closure, span
• Interface range, domain compatibility
• Finding the values
• Domains & Testability
• Linearizing, coordinate transformations. Canonical program form
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
Domain Testing
Two Views
• Based on Specs
• Functional Testing
• Structural Technique
• Variables
• Simple combinations of two variables
• Numbers from - to +
• Loop-free Programs
Domain (simplified)
• Specified by predicates
Predicates
• Interpretation
Paths
Summary:
• Domain for a loop-free program corresponds to a set of
numbers defined over the input vector
MIN MAX
D1 D2 D3
Closed
X >= MIN
D2 X < MAX
D1 D3
MIN MAX
D1 D2 D3
Open
X > MIN X < MAX
• Slicing Boundary
• Double-zero representation
• Contradictory domains
undefined
17 ref boris beizer
Domain Testing - Domains & Paths – Bug Assumptions.. U3
• 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
Simplification of compound
predicates
In General…
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
Compound predicates….
• 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
Nice Domains
U1 U2
V1 D11 D12
V2 D21 D22
Nice Domains
Advantages
• Ease of DT
Nice Domains
Boundaries are
1. Complete
6. Convex
2. Systematic
1. Linear Boundaries
n-dim Hyperplane:
n+1 Points
Non-Linear
• Transform
34 ref boris beizer
Domain Testing - Domains & Paths – Nice domains U3
2. Complete Boundaries
Incomplete…
• Reasons
• Tests
3. Systematic Boundaries
• Linear Inequalities differing by a constant
• Parallel lines
• Identical Sectors in a Circle
• DT
36 • Test a domain Tests for other Domains
ref boris beizer
Domain Testing - Domains & Paths - Nice domains U3
4. Orthogonal Boundaries
• Parallel to axes
Vj
• DT
• # Tests O (n)
Orthogonal Boundaries
• Tilted sets
• transformation
• Test cases: O(n)
• Rectangular coordinates
• Polar
r ≥ aj .AND. r < aj+1 .AND.
≥ j .AND. < j+1
38 ref boris beizer
Domain Testing - Domains & Paths - Nice domains U3
Non-Orthogonal Boundaries
5. Closure Consistency
• Example
D3 D1 D2 D4
6. Convex Domain
• Line joining any two points lies with in the domain
• DT
• n on-points & 1 off-pt
Concave
D2
D1
• 2 complementary domains
• Programmer / Designer
• Convex part First
42 ref boris beizer
Domain Testing - Domains & Paths – Ugly Domains U3
Generally,
Causes
1. Non-linear Boundaries
1. Non-linear Boundaries
• Transform
2. Ambiguities
• Missing boundary
2. Contradictions..
• Overlapping of
• Domain Specs
• Closure Specs
D3
D1 D2
• Complexity !
• Filling in Holes
Correct:
General DT Strategy
Generally,
• Interior point
• Exterior point
• Epsilon neighborhood
• Extreme point
• On point
Extreme
point
Boundary point
Epsilon neighborhood
On Points
Domain D1
54 ref boris beizer
Domain Testing - Domains & Paths – Domain Testing U3
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
4. Random Testing
• Independent testing
62 ref boris beizer
Domain Testing - Domains & Paths – Domain Testing U3
Procedure
Effectiveness
• Cost effective
• Domain
• Range
Variable
Range for Domain for Range for
Routine 1 Routine 2
Domain Routine1 Routine2 Routine2
• Span compatibility
• Closure compatibility
• Linearizing transformations
• Polynomial
• Rectangular to polar
• Generic & rational => Taylor series
• Co-ordinate transformations