SlideShare a Scribd company logo
1 of 36
Subject Name:
Software Testing
Subject Code:
10CS842
Prepared By:
Tamilarasi.R
Department:
CSE
Date
11/11/2023
Unit –II
Boundary Value Testing,
Equivalence Class Testing, Decision
Table-Based Testing
11/11/2023
11/11/2023
Topics
• Boundary value analysis
• Robustness testing
• Worst-case testing
• Special value testing
• Examples, Random testing, Equivalence classes,
Equivalence test cases for the triangle problem, Next
Date function, and the commission problem,
Guidelines and observations. Decision tables, Test
cases for the triangle problem, Next Date function,
and the commission problem, Guidelines and
observations.
4
Boundary Value Analysis
• Boundary value analysis focuses on the boundary of the
input space to identify test cases.
• The rationale behind boundary value analysis is that errors
tend to occur near the extreme values of an input
variable.
• Programs written in non-strongly typed languages are
more appropriate candidates for boundary value testing.
• In our discussion we will assume a program P accepting
two inputs x1 andx2 such that a ≤ y1 ≤ b and c ≤ y2 ≤ d
5
Valid Input for Program P
• consider the following function:
• boundary inequalities of n input variables define an n-
dimensional input space:
d
y
c
b
y
a
y
y
f 


 2
1
2
1 ,
where
),
,
(
a b
c
d
y2
y1
6
Value Selection in Boundary Value
Analysis
• The basic idea in boundary value analysis is to
select input variable values at their:
– Minimum
– Just above the minimum
– A nominal value
– Just below the maximum
– Maximum
7
Single Fault Assumption
• Boundary value analysis is also augmented by the
single fault assumption principle.
“Failures occur rarely as the result of the
simultaneous occurrence of two (or more) faults”
• In this respect, boundary value analysis test cases can
be obtained by holding the values of all but one
variable at their nominal values, and letting that
variable assume its extreme values.
8
Boundary Value Analysis for Program
P
T = { <y1nom, y2min>, <y1nom, y2min+>, <y1nom, y2nom>, <y1nom, y2max->,
<y1nom, y2max+>, <y1min, y2nom>, < 1nin+, y2nom>, <y1max-, y2nom>,
<y1max, y2nom> }
a b
c
d
y2
y1
.. . ..
.
.
.
.
9
Example Test Cases Using Boundary
Value Analysis
Case # a b c Expected Output
1 100 100 1 Isosceles
2 100 100 2 Isosceles
3 100 100 100 Equilateral
4 100 100 199 Isosceles
5 100 100 200 Not a Trianle
6 100 1 100 Isosceles
7 100 2 100 Isosceles
8 100 100 100 Equilateral
9 100 199 100 Isosceles
10 100 200 100 Not a Triangle
11 1 100 100 Isosceles
12 2 100 100 Isosceles
13 100 100 100 Equilateral
14 199 100 100 Isosceles
15 200 100 100 Not a Triangle
10
Generalizing Boundary Value Analysis
• The basic boundary value analysis can be
generalized in two ways:
– By the number of variables - (4n +1) test cases
for n variables
– By the kinds of ranges of variables
• Programming language dependent
• Bounded discrete
• Unbounded discrete (no upper or lower bounds
clearly defined)
• Logical variables
11
Limitations of Boundary Value Analysis
• Boundary value analysis works well when the program to be
tested is a function of several independent variables that
represent bounded physical quantities.
• Boundary value analysis selected test data with no
consideration of the function of the program, nor of the
semantic meaning of the variables.
• We can distinguish between physical and logical type of
variables as well (e.g. temperature, pressure speed, or PIN
numbers, telephone numbers etc.)
12
Independence Assumption and
Efficacy of BVT
• Assumes that input variables are independent of one another,
– i.e. the assumption that particular combinations of input variable values have no
special significance
• If basic assumption is not true, then BVT may overlook important test
requirements
• BVT is an instance of more general techniques such as equivalence class
testing or domain testing.
• BVT tends to generate more test cases with poorer test coverage (with the
independence assumption) than domain or equivalence testing.
• But, due to its simplicity, BVT test case generation can be easily automated.
13
Robustness Testing
• Robustness testing is a simple extension of boundary value
analysis.
• In addition to the five boundary value analysis values of
variables, we add values slightly greater that the maximum
(max+) and a value slightly less than the minimum (min-).
• The main value of robustness testing is to force attention on
exception handling.
• In some strongly typed languages values beyond the predefined
range will cause a run-time error.
• It is a choice of using a weak typed language with exception
handling or a strongly typed language with explicit logic to
handle out of range values.
14
Robustness Test Cases for Program P
a b
c
d
y2
y1
... . …
.
.
.
.
.
.
15
Worst Case Testing
• In worst case testing we reject the single fault assumption ans we are
interested what happens when more than one variable has an
extreme value.
• Considering that we have five different values that can be considered
during boundary value analysis testing for one variable, now we take
the Cartesian product of these possible values for 2, 3, … n variables.
• In this respect we can have 5n test cases for n input variables.
• The best application of worst case testing is where physical variables
have numerous interactions and failure of a program is costly.
• Worst case testing can be further augmented by considering robust
worst case testing (i.e. adding slightly out of bounds values to the five
already considered).
16
Worst Case Testing for Program P
a b
c
d
y2
y1
.. . ..
.. . ..
.. . ..
.. . ..
.. . ..
17
Robust Worst Case Testing for Program
P
a b
c
d
y2
y1
... . …
... . …
... . …
... . …
... . …
... . …
... . …
18
Special Value Testing
• Special value testing is probably the most widely practiced
form of functional testing, most intuitive, and least uniform.
• Utilizes domain knowledge and engineering judgment about
program’s “soft spots” to devise test cases.
• Event though special value testing is very subjective on the
generation of test cases, it is often more effective on revealing
program faults.
19
Guidelines for Boundary Value Testing
• With the exception of special value testing, the test methods based
on the boundary values of a program are the most rudimentary.
• Issues in producing satisfactory test cases using boundary value
testing:
– Truly independent variables versus not independent variables
– Normal versus robust values
– Single fault versus multiple fault assumption
• Boundary value analysis can also be applied to the output range of a
program (i.e. error messages), and internal variables (i.e. loop control
variables, indices, and pointers).
20
The Commission Problem
• Rifle salespersons in the Arizona Territory sold rifle locks,
stocks, and barrels made by a gunsmith in Missouri
• Lock = $45.00, stock = $30.00, barrel = $25.00
• Each salesperson had to sell at least one complete rifle per
month ($100)
• The most one salesperson could sell in a month was 70 locks,
80 stocks, and 90 barrels
• Each salesperson sent a telegram to the Missouri company
with the total order for each town (s)he visits
• 1≤towns visited≤10, per month
• Commission: 10% on sales up to $1000, 15% on the next
$800, and 20% on any sales in excess of $1800
21
Example Test Cases Using Output Range Values
80
90
60
60
70
72
40
22.2
33.3
Stocks
Locks
Barrels
22
Output Boundary Value Test Cases
Case # Locks Stocks Barrels Sales Comm. Comments
1 1 1 1 100 10 min
2 10 10 9 975 97.5 border-
3 10 9 10 970 97 border-
4 9 10 10 955 95.5 border-
5 10 10 10 1000 100 border
6 10 10 11 1025 103.75 border+
7 10 11 10 1030 104.5 border+
8 11 10 10 1045 106.75 border+
23
Output Special Value Test Cases
Case # Locks Stocks Barrels Sales Comm. Comment
1 10 11 9 1005 100.75 border+
2 18 17 19 1795 219.25 border+
3 18 19 17 1805 221 border+
11/11/2023
Random testing
• Random testing is a black-box software testing technique
where programs are tested by generating random,
independent inputs. Results of the output are compared
against software specifications to verify that the test output
is pass or fail.
• In case of absence of specifications the exceptions of the
language are used which means if an exception arises during
test execution then it means there is a fault in the program.
Equivalence Classes
• In mathematics, when a set has an equivalence
relation defined on its elements, there is a natural grouping
of elements that are related to one another, forming what
are called equivalence classes.
• An equivalence relation is a binary relation ~ satisfying three properties:
• For every element a in X, a ~ a (reflexivity),
• For every two elements a and b in X, if a ~ b, then b ~ a (symmetry)
• For every three elements a, b, and c in X, if a ~ b and b ~ c, then a ~ c (transitivity).
• The equivalence class of an element a is denoted [a] and is defined as the set
• of elements that are related to a by ~.
11/11/2023
26
Equivalence Class Test Cases for the Triangle
Problem
• Outputs: Not a Triangle, Scalene, Isosceles, Equilateral
• Easier to identify output (range) equivalence classes
– R1 = {<a, b, c> : the triangle with sides a, b, and c is equilateral}
– R2 = {<a, b, c> : the triangle with sides a, b, and c is isosceles}
– R3 = {<a, b, c> : the triangle with sides a, b, and c is scalene}
– R4 = {<a, b, c> : sides a, b, and c do not form a triangle}
T
e
s
tC
a
s
e a b c E
x
p
e
c
te
dO
u
tp
u
t
O
E
1 5 5 5 E
q
u
ila
te
ra
l
O
E
2 2 2 3 Is
o
s
c
e
le
s
O
E
3 3 4 5 S
c
a
le
n
e
O
E
4 4 1 2 N
o
taT
ria
n
g
le
27
Equivalence Class Test Cases for the Triangle
Problem
• Input (domain) equivalence classes
D1 = {<a, b, c> : a = b = c}
D2 = {<a, b, c> : a = b, a ≠ c}
D3 = {<a, b, c> : a = c, a ≠ b}
D4 = {<a, b, c> : b = c, a ≠ b}
D5 = {<a, b, c> : a ≠ b, a ≠ c, b ≠ c}
// D6 = {<a, b, c> : a ≥ b + c}
D6’ = {<a, b, c> : a = b + c}
D6’’ = {<a, b, c> : a > b + c}
// D7 = {<a, b, c> : b ≥ a + c}
D7’ = {<a, b, c> : b = a + c}
D7’’ = {<a, b, c> : b > a + c}
// D8 = {<a, b, c> : c ≥ a + b}
D8’ = {<a, b, c> : c = a + b}
D8’’ = {<a, b, c> : c > a + b}
28 University of Waterloo
Equivalence Class Test Cases for the NextDate
Function
• Input variables
– 1 ≤ month ≤ 12
– 1 ≤ day ≤ 31
– 1812 ≤ year ≤ 2012
• Traditional approach
– Valid equivalence classes
• M1 = { month : 1 ≤ month ≤ 12 }
• D1 = { day : 1 ≤ day ≤ 31 }
• Y1 = { year : 1812 ≤ year ≤ 2012 }
– Invalid equivalence classes
• M2 = { month : month < 1 }
• M3 = { month : month > 12 }
• D2 = { day : day < 1 }
• D3 = { day : day >31 }
• Y2 = { year : year < 1812 }
• Y3 = {year : year > 2012 }
C
a
s
eID M
o
n
th D
a
y Y
e
a
r E
x
p
e
c
te
dO
u
tp
u
t
T
E
1 6 1
5 1
9
1
2 6
/1
6
/1
9
1
2
T
E
2 -
1 1
5 1
9
1
2 in
v
a
lidin
p
u
t
T
E
3 1
3 1
5 1
9
1
2 in
v
a
lidin
p
u
t
T
E
4 6 -
1 1
9
1
2 in
v
a
lidin
p
u
t
T
E
5 6 3
2 1
9
1
2 in
v
a
lidin
p
u
t
T
E
6 6 1
5 1
8
1
1 in
v
a
lidin
p
u
t
T
E
7 6 1
5 2
0
1
3 in
v
a
lidin
p
u
t
29 Universi
Equivalence Class Test Cases for the NextDate
Function
• Traditional approach is deficient because it “treats” the
elements of a class at the valid/invalid level
• Different approach: What must be done to an input date?
M1 = { month: month has 30 days }
M2 = { month: month has 31 days }
M3 = { month: month is February }
D1 = { day: 1 ≤ day ≤ 28 }
D2 = { day: day = 29 }
D3 = { day: day = 30 }
D4 = { day: day = 31 }
Y1 = { year: year = 1900 }
Y2 = { year: 1812 ≤ year ≤ 2012 AND (year ≠ 1900)
AND (year mod 4 = 0) }
Y3 = { year: 1812 ≤ year ≤ 2012 AND (year mod 4 ≠ 0) }
Not a perfect set of equivalence classes!!!
30
Equivalence Class Test Cases for the NextDate
Function
C
a
s
eID M
o
n
th D
a
y Y
e
a
r E
x
p
e
c
te
dO
u
tp
u
t
W
E
1 6 1
4 1
9
0
0 6
/1
5
/1
9
0
0
W
E
2 7 2
9 1
9
1
2 7
/3
0
/1
9
1
2
W
E
3 2 3
0 1
9
1
3 in
v
a
lidin
p
u
t
W
E
4 6 3
1 1
9
0
0 in
v
a
lidin
p
u
t
Weak equivalence class test cases
Case ID Month Day Year Expected Output
SE1 6 14 1900 6/15/1900
SE2 6 14 1912 6/15/1912
SE3 6 14 1913 6/15/1913
SE4 6 29 1900 6/30/1900
SE5 6 29 1912 6/30/1912
SE6 6 29 1913 6/30/1913
SE7 6 30 1900 07/01/1900
SE8 6 30 1912 07/01/1912
SE9 6 30 1913 07/01/1913
SE10 6 31 1900 ERROR
SE11 6 31 1912 ERROR
SE12 6 31 1913 ERROR
SE13 7 14 1900 7/15/1900
SE14 7 14 1912 7/15/1912
SE15 7 14 1913 7/15/1913
SE16 7 29 1900 7/30/1900
SE17 7 29 1912 7/30/1912
SE18 7 29 1913 7/30/1913
Case ID Month Day Year Expected Output
SE19 7 30 1900 7/31/1900
SE20 7 30 1912 7/31/1912
SE21 7 30 1913 7/31/1913
SE22 7 31 1900 08/01/1900
SE23 7 31 1912 08/01/1912
SE24 7 31 1913 08/01/1913
SE25 2 14 1900 2/15/1900
SE26 2 14 1912 2/15/1912
SE27 2 14 1913 2/15/1913
SE28 2 29 1900 ERROR
SE29 2 29 1912 03/01/1912
SE30 2 29 1913 ERROR
SE31 2 30 1900 ERROR
SE32 2 30 1912 ERROR
SE33 2 30 1913 ERROR
SE34 2 31 1900 ERROR
SE35 2 31 1912 ERROR
SE36 2 31 1913 ERROR
Strong equivalence class test cases
SE 465/ECE 453 31 University of Waterloo
Equivalence Class Test Cases for the Commission
Problem
• Input Domain Equivalence Classes
– Lock
• L1 = { lock: 1 ≤ lock ≤ 70 }
• L2 = { lock: lock < 1 }
• L3 = { lock: lock > 70 }
– Stock
• S1 = { stock: 1 ≤ stock ≤ 80 }
• S2 = { stock: stock < 1 }
• S3 = { stock: stock > 80 }
– Barrel
• B1 = { barrel: 1 ≤ barrel ≤ 90 }
• B2 = { barrel: barrel < 1 }
• B3 = { barrel: barrel > 90 }
32
Equivalence Class Test Cases for the Commission
Problem
Strong Input Domain Equivalence Class Test Cases
Test Case locks stocks barrels sales com m ission
SE1 35 40 45 3900 640
SE2 35 40 0 ERROR ERROR
SE3 35 40 91 ERROR ERROR
SE4 35 0 45 ERROR ERROR
SE5 35 0 0 ERROR ERROR
SE6 35 0 91 ERROR ERROR
SE7 35 81 45 ERROR ERROR
SE8 35 81 0 ERROR ERROR
SE9 35 81 91 ERROR ERROR
SE10 0 40 45 ERROR ERROR
SE11 0 40 0 ERROR ERROR
SE12 0 40 91 ERROR ERROR
SE13 0 0 45 ERROR ERROR
SE14 0 0 0 ERROR ERROR
SE15 0 0 91 ERROR ERROR
SE16 0 81 45 ERROR ERROR
SE17 0 81 0 ERROR ERROR
SE18 0 81 91 ERROR ERROR
SE19 71 40 45 ERROR ERROR
SE20 71 40 0 ERROR ERROR
SE21 71 40 91 ERROR ERROR
SE22 71 0 45 ERROR ERROR
SE23 71 0 0 ERROR ERROR
SE24 71 0 91 ERROR ERROR
SE25 71 81 45 ERROR ERROR
SE26 71 81 0 ERROR ERROR
SE27 71 81 91 ERROR ERROR
T
e
s
t
C
a
s
e
l
o
c
k
ss
t
o
c
k
s
b
a
r
r
e
l
ss
a
l
e
sc
o
m
m
i
s
s
i
o
n
W
E
1 3
5 4
0 4
5 3
9
0
0 6
4
0
W
E
2 0 0 0 E
R
R
O
R
E
R
R
O
R
W
E
3 7
1 8
1 9
1 E
R
R
O
R
E
R
R
O
R
Weak Input Domain Equivalence Class Test Cases
33
Equivalence Class Test Cases for the Commission
Problem
• sales = 45 x locks + 30 x stocks + 25 x barrels
• L1 = { <lock, stock, barrel> : sales ≤ 1000 }
• L2 = { <lock, stock, barrel> : 1000 < sales ≤ 1800 }
• L3 = { <lock, stock, barrel> : sales > 1800 }
Output Range Equivalence Class Test Cases
T
e
s
t
C
a
s
e
l
o
c
k
ss
t
o
c
k
s
b
a
r
r
e
l
ss
a
l
e
sc
o
m
m
i
s
s
i
o
n
O
R
1 5 5 5 5
0
0 5
0
O
R
2 1
5 1
5 1
5 1
5
0
0 1
7
5
O
R
3 2
5 2
5 2
5 2
5
0
0 3
6
0
34 University of Waterloo
Guidelines and Observations
1. The traditional form of equivalence class testing is generally
not as thorough as weak equivalence class testing, which in
turn, is not as thorough as the strong form of equivalence
class testing
2. The only time it makes sense to use the traditional
approach is when the implementation language is not
strongly typed
3. If error conditions are a high priority, we could extend
strong equivalence class testing to include invalid classes
(e.g. commission problem)
4. Equivalence class testing is appropriate when input data is
defined in terms of ranges and sets of discrete values. This
is certainly the case when system malfunctions can occur
for out-of-limit variable values
35 University of Waterloo
Guidelines and Observations
1. Equivalence class testing is strengthened by a hybrid
approach with boundary value testing. (We can “reuse” the
effort made in defining the equivalence classes) (e.g.
NextDate function)
2. Equivalence class testing is indicated when the program
function is complex. In such cases, the complexity of the
function can help identify useful equivalence classes, as in
the NextDate function
3. Strong equivalence class testing makes a presumption that
the variables are independent when the Cartesian Product
is taken. If there are any dependencies, these will often
generate “error” test cases, as they did in the NextDate
function
36 University of Waterloo
Guidelines and Observations
1. Several tries may be needed before “the
right” equivalence relation is discovered, as
we saw in the NextDate example. In other
cases, there is an “obvious” or “natural”
equivalence partition. When in doubt, the
best bet is to try to second guess aspects of
any reasonable implementation

More Related Content

What's hot

Formal Verification
Formal VerificationFormal Verification
Formal VerificationIlia Levin
 
Tips for Writing Better Charters for Exploratory Testing Sessions by Michael...
 Tips for Writing Better Charters for Exploratory Testing Sessions by Michael... Tips for Writing Better Charters for Exploratory Testing Sessions by Michael...
Tips for Writing Better Charters for Exploratory Testing Sessions by Michael...TEST Huddle
 
Testing concepts [3] - Software Testing Techniques (CIS640)
Testing concepts [3] - Software Testing Techniques (CIS640)Testing concepts [3] - Software Testing Techniques (CIS640)
Testing concepts [3] - Software Testing Techniques (CIS640)Venkatesh Prasad Ranganath
 
Agile Testing Best Practices
Agile Testing Best PracticesAgile Testing Best Practices
Agile Testing Best PracticesStephen Ritchie
 
Cloud Testing : An Overview
Cloud Testing : An OverviewCloud Testing : An Overview
Cloud Testing : An OverviewQA InfoTech
 
Software Testing Life Cycle (STLC) | Software Testing Tutorial | Edureka
Software Testing Life Cycle (STLC) | Software Testing Tutorial | EdurekaSoftware Testing Life Cycle (STLC) | Software Testing Tutorial | Edureka
Software Testing Life Cycle (STLC) | Software Testing Tutorial | EdurekaEdureka!
 
Qa exploratory test charter template
Qa exploratory test charter templateQa exploratory test charter template
Qa exploratory test charter templateRob Swoboda
 
Testes Automatizados de Software Um Guia Pratico by Mauricio Aniche (z-lib.or...
Testes Automatizados de Software Um Guia Pratico by Mauricio Aniche (z-lib.or...Testes Automatizados de Software Um Guia Pratico by Mauricio Aniche (z-lib.or...
Testes Automatizados de Software Um Guia Pratico by Mauricio Aniche (z-lib.or...RodrigoLuis21
 
Why you should switch to Cypress for modern web testing?
Why you should switch to Cypress for modern web testing?Why you should switch to Cypress for modern web testing?
Why you should switch to Cypress for modern web testing?Shivam Bharadwaj
 
End to end test automation with cypress
End to end test automation with cypressEnd to end test automation with cypress
End to end test automation with cypressPankajSingh184960
 
What is this exploratory testing thing
What is this exploratory testing thingWhat is this exploratory testing thing
What is this exploratory testing thingtonybruce
 
Object Oriented Testing
Object Oriented TestingObject Oriented Testing
Object Oriented TestingAjeng Savitri
 
The Axioms of Testing
The Axioms of TestingThe Axioms of Testing
The Axioms of TestingPaul Gerrard
 
Unit Testing vs Integration Testing
Unit Testing vs Integration TestingUnit Testing vs Integration Testing
Unit Testing vs Integration TestingRock Interview
 
Agile Testing and Test Automation
Agile Testing and Test AutomationAgile Testing and Test Automation
Agile Testing and Test AutomationNaveen Kumar Singh
 
Cypress - Best Practices
Cypress - Best PracticesCypress - Best Practices
Cypress - Best PracticesBrian Mann
 
Prolog Programming Language
Prolog Programming  LanguageProlog Programming  Language
Prolog Programming LanguageReham AlBlehid
 

What's hot (20)

Formal Verification
Formal VerificationFormal Verification
Formal Verification
 
Tips for Writing Better Charters for Exploratory Testing Sessions by Michael...
 Tips for Writing Better Charters for Exploratory Testing Sessions by Michael... Tips for Writing Better Charters for Exploratory Testing Sessions by Michael...
Tips for Writing Better Charters for Exploratory Testing Sessions by Michael...
 
Testing concepts [3] - Software Testing Techniques (CIS640)
Testing concepts [3] - Software Testing Techniques (CIS640)Testing concepts [3] - Software Testing Techniques (CIS640)
Testing concepts [3] - Software Testing Techniques (CIS640)
 
Agile Testing Best Practices
Agile Testing Best PracticesAgile Testing Best Practices
Agile Testing Best Practices
 
Cloud Testing : An Overview
Cloud Testing : An OverviewCloud Testing : An Overview
Cloud Testing : An Overview
 
Software Testing Life Cycle (STLC) | Software Testing Tutorial | Edureka
Software Testing Life Cycle (STLC) | Software Testing Tutorial | EdurekaSoftware Testing Life Cycle (STLC) | Software Testing Tutorial | Edureka
Software Testing Life Cycle (STLC) | Software Testing Tutorial | Edureka
 
Qa exploratory test charter template
Qa exploratory test charter templateQa exploratory test charter template
Qa exploratory test charter template
 
Testes Automatizados de Software Um Guia Pratico by Mauricio Aniche (z-lib.or...
Testes Automatizados de Software Um Guia Pratico by Mauricio Aniche (z-lib.or...Testes Automatizados de Software Um Guia Pratico by Mauricio Aniche (z-lib.or...
Testes Automatizados de Software Um Guia Pratico by Mauricio Aniche (z-lib.or...
 
Static Testing
Static TestingStatic Testing
Static Testing
 
Why you should switch to Cypress for modern web testing?
Why you should switch to Cypress for modern web testing?Why you should switch to Cypress for modern web testing?
Why you should switch to Cypress for modern web testing?
 
End to end test automation with cypress
End to end test automation with cypressEnd to end test automation with cypress
End to end test automation with cypress
 
What is this exploratory testing thing
What is this exploratory testing thingWhat is this exploratory testing thing
What is this exploratory testing thing
 
Object Oriented Testing
Object Oriented TestingObject Oriented Testing
Object Oriented Testing
 
The Axioms of Testing
The Axioms of TestingThe Axioms of Testing
The Axioms of Testing
 
Protoytyping Model
Protoytyping ModelProtoytyping Model
Protoytyping Model
 
Unit Testing vs Integration Testing
Unit Testing vs Integration TestingUnit Testing vs Integration Testing
Unit Testing vs Integration Testing
 
Agile Testing and Test Automation
Agile Testing and Test AutomationAgile Testing and Test Automation
Agile Testing and Test Automation
 
Cypress - Best Practices
Cypress - Best PracticesCypress - Best Practices
Cypress - Best Practices
 
Prolog Programming Language
Prolog Programming  LanguageProlog Programming  Language
Prolog Programming Language
 
Path Testing
Path TestingPath Testing
Path Testing
 

Similar to st_unit_2.ppt

Equivalence partinioning and boundary value analysis
Equivalence partinioning and boundary value analysisEquivalence partinioning and boundary value analysis
Equivalence partinioning and boundary value analysisniharika5412
 
Testing foundations
Testing foundationsTesting foundations
Testing foundationsNeha Singh
 
Software Testing - Boundary Value Analysis, Equivalent Class Partition, Decis...
Software Testing - Boundary Value Analysis, Equivalent Class Partition, Decis...Software Testing - Boundary Value Analysis, Equivalent Class Partition, Decis...
Software Testing - Boundary Value Analysis, Equivalent Class Partition, Decis...priyasoundar
 
Software Testing Introduction (Part 2)
Software Testing Introduction (Part 2)Software Testing Introduction (Part 2)
Software Testing Introduction (Part 2)Thapar Institute
 
Dynamic Testing
Dynamic TestingDynamic Testing
Dynamic TestingJimi Patel
 
Testcase design techniques final
Testcase design techniques finalTestcase design techniques final
Testcase design techniques finalshraavank
 
Black boxtesting
Black boxtestingBlack boxtesting
Black boxtestingfuntest06
 
Software Engineering : Software testing
Software Engineering : Software testingSoftware Engineering : Software testing
Software Engineering : Software testingAjit Nayak
 
CS8494 SOFTWARE ENGINEERING Unit-4
CS8494 SOFTWARE ENGINEERING Unit-4CS8494 SOFTWARE ENGINEERING Unit-4
CS8494 SOFTWARE ENGINEERING Unit-4SIMONTHOMAS S
 

Similar to st_unit_2.ppt (20)

Equivalence partinioning and boundary value analysis
Equivalence partinioning and boundary value analysisEquivalence partinioning and boundary value analysis
Equivalence partinioning and boundary value analysis
 
Testing foundations
Testing foundationsTesting foundations
Testing foundations
 
Software Testing - Boundary Value Analysis, Equivalent Class Partition, Decis...
Software Testing - Boundary Value Analysis, Equivalent Class Partition, Decis...Software Testing - Boundary Value Analysis, Equivalent Class Partition, Decis...
Software Testing - Boundary Value Analysis, Equivalent Class Partition, Decis...
 
AutoTest.ppt
AutoTest.pptAutoTest.ppt
AutoTest.ppt
 
AutoTest.ppt
AutoTest.pptAutoTest.ppt
AutoTest.ppt
 
AutoTest.ppt
AutoTest.pptAutoTest.ppt
AutoTest.ppt
 
Software Testing Introduction (Part 2)
Software Testing Introduction (Part 2)Software Testing Introduction (Part 2)
Software Testing Introduction (Part 2)
 
Dynamic Testing
Dynamic TestingDynamic Testing
Dynamic Testing
 
11 whiteboxtesting
11 whiteboxtesting11 whiteboxtesting
11 whiteboxtesting
 
Black box & white-box testing technique
Black box & white-box testing techniqueBlack box & white-box testing technique
Black box & white-box testing technique
 
Testcase design techniques final
Testcase design techniques finalTestcase design techniques final
Testcase design techniques final
 
SE%200-Testing%20(2).pptx
SE%200-Testing%20(2).pptxSE%200-Testing%20(2).pptx
SE%200-Testing%20(2).pptx
 
Black boxtesting
Black boxtestingBlack boxtesting
Black boxtesting
 
Test design techniques
Test design techniquesTest design techniques
Test design techniques
 
Software Engineering : Software testing
Software Engineering : Software testingSoftware Engineering : Software testing
Software Engineering : Software testing
 
CS8494 SOFTWARE ENGINEERING Unit-4
CS8494 SOFTWARE ENGINEERING Unit-4CS8494 SOFTWARE ENGINEERING Unit-4
CS8494 SOFTWARE ENGINEERING Unit-4
 
Testing part 2 bb
Testing part 2 bbTesting part 2 bb
Testing part 2 bb
 
Unit 6
Unit 6Unit 6
Unit 6
 
Black Box Testing
Black Box TestingBlack Box Testing
Black Box Testing
 
black-box-1.pdf
black-box-1.pdfblack-box-1.pdf
black-box-1.pdf
 

Recently uploaded

APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLDeelipZope
 
microprocessor 8085 and its interfacing
microprocessor 8085  and its interfacingmicroprocessor 8085  and its interfacing
microprocessor 8085 and its interfacingjaychoudhary37
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...srsj9000
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfAsst.prof M.Gokilavani
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝soniya singh
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girlsssuser7cb4ff
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AIabhishek36461
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx959SahilShah
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxDeepakSakkari2
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 

Recently uploaded (20)

★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCL
 
microprocessor 8085 and its interfacing
microprocessor 8085  and its interfacingmicroprocessor 8085  and its interfacing
microprocessor 8085 and its interfacing
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girls
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AI
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptx
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 

st_unit_2.ppt

  • 1. Subject Name: Software Testing Subject Code: 10CS842 Prepared By: Tamilarasi.R Department: CSE Date 11/11/2023
  • 2. Unit –II Boundary Value Testing, Equivalence Class Testing, Decision Table-Based Testing 11/11/2023
  • 3. 11/11/2023 Topics • Boundary value analysis • Robustness testing • Worst-case testing • Special value testing • Examples, Random testing, Equivalence classes, Equivalence test cases for the triangle problem, Next Date function, and the commission problem, Guidelines and observations. Decision tables, Test cases for the triangle problem, Next Date function, and the commission problem, Guidelines and observations.
  • 4. 4 Boundary Value Analysis • Boundary value analysis focuses on the boundary of the input space to identify test cases. • The rationale behind boundary value analysis is that errors tend to occur near the extreme values of an input variable. • Programs written in non-strongly typed languages are more appropriate candidates for boundary value testing. • In our discussion we will assume a program P accepting two inputs x1 andx2 such that a ≤ y1 ≤ b and c ≤ y2 ≤ d
  • 5. 5 Valid Input for Program P • consider the following function: • boundary inequalities of n input variables define an n- dimensional input space: d y c b y a y y f     2 1 2 1 , where ), , ( a b c d y2 y1
  • 6. 6 Value Selection in Boundary Value Analysis • The basic idea in boundary value analysis is to select input variable values at their: – Minimum – Just above the minimum – A nominal value – Just below the maximum – Maximum
  • 7. 7 Single Fault Assumption • Boundary value analysis is also augmented by the single fault assumption principle. “Failures occur rarely as the result of the simultaneous occurrence of two (or more) faults” • In this respect, boundary value analysis test cases can be obtained by holding the values of all but one variable at their nominal values, and letting that variable assume its extreme values.
  • 8. 8 Boundary Value Analysis for Program P T = { <y1nom, y2min>, <y1nom, y2min+>, <y1nom, y2nom>, <y1nom, y2max->, <y1nom, y2max+>, <y1min, y2nom>, < 1nin+, y2nom>, <y1max-, y2nom>, <y1max, y2nom> } a b c d y2 y1 .. . .. . . . .
  • 9. 9 Example Test Cases Using Boundary Value Analysis Case # a b c Expected Output 1 100 100 1 Isosceles 2 100 100 2 Isosceles 3 100 100 100 Equilateral 4 100 100 199 Isosceles 5 100 100 200 Not a Trianle 6 100 1 100 Isosceles 7 100 2 100 Isosceles 8 100 100 100 Equilateral 9 100 199 100 Isosceles 10 100 200 100 Not a Triangle 11 1 100 100 Isosceles 12 2 100 100 Isosceles 13 100 100 100 Equilateral 14 199 100 100 Isosceles 15 200 100 100 Not a Triangle
  • 10. 10 Generalizing Boundary Value Analysis • The basic boundary value analysis can be generalized in two ways: – By the number of variables - (4n +1) test cases for n variables – By the kinds of ranges of variables • Programming language dependent • Bounded discrete • Unbounded discrete (no upper or lower bounds clearly defined) • Logical variables
  • 11. 11 Limitations of Boundary Value Analysis • Boundary value analysis works well when the program to be tested is a function of several independent variables that represent bounded physical quantities. • Boundary value analysis selected test data with no consideration of the function of the program, nor of the semantic meaning of the variables. • We can distinguish between physical and logical type of variables as well (e.g. temperature, pressure speed, or PIN numbers, telephone numbers etc.)
  • 12. 12 Independence Assumption and Efficacy of BVT • Assumes that input variables are independent of one another, – i.e. the assumption that particular combinations of input variable values have no special significance • If basic assumption is not true, then BVT may overlook important test requirements • BVT is an instance of more general techniques such as equivalence class testing or domain testing. • BVT tends to generate more test cases with poorer test coverage (with the independence assumption) than domain or equivalence testing. • But, due to its simplicity, BVT test case generation can be easily automated.
  • 13. 13 Robustness Testing • Robustness testing is a simple extension of boundary value analysis. • In addition to the five boundary value analysis values of variables, we add values slightly greater that the maximum (max+) and a value slightly less than the minimum (min-). • The main value of robustness testing is to force attention on exception handling. • In some strongly typed languages values beyond the predefined range will cause a run-time error. • It is a choice of using a weak typed language with exception handling or a strongly typed language with explicit logic to handle out of range values.
  • 14. 14 Robustness Test Cases for Program P a b c d y2 y1 ... . … . . . . . .
  • 15. 15 Worst Case Testing • In worst case testing we reject the single fault assumption ans we are interested what happens when more than one variable has an extreme value. • Considering that we have five different values that can be considered during boundary value analysis testing for one variable, now we take the Cartesian product of these possible values for 2, 3, … n variables. • In this respect we can have 5n test cases for n input variables. • The best application of worst case testing is where physical variables have numerous interactions and failure of a program is costly. • Worst case testing can be further augmented by considering robust worst case testing (i.e. adding slightly out of bounds values to the five already considered).
  • 16. 16 Worst Case Testing for Program P a b c d y2 y1 .. . .. .. . .. .. . .. .. . .. .. . ..
  • 17. 17 Robust Worst Case Testing for Program P a b c d y2 y1 ... . … ... . … ... . … ... . … ... . … ... . … ... . …
  • 18. 18 Special Value Testing • Special value testing is probably the most widely practiced form of functional testing, most intuitive, and least uniform. • Utilizes domain knowledge and engineering judgment about program’s “soft spots” to devise test cases. • Event though special value testing is very subjective on the generation of test cases, it is often more effective on revealing program faults.
  • 19. 19 Guidelines for Boundary Value Testing • With the exception of special value testing, the test methods based on the boundary values of a program are the most rudimentary. • Issues in producing satisfactory test cases using boundary value testing: – Truly independent variables versus not independent variables – Normal versus robust values – Single fault versus multiple fault assumption • Boundary value analysis can also be applied to the output range of a program (i.e. error messages), and internal variables (i.e. loop control variables, indices, and pointers).
  • 20. 20 The Commission Problem • Rifle salespersons in the Arizona Territory sold rifle locks, stocks, and barrels made by a gunsmith in Missouri • Lock = $45.00, stock = $30.00, barrel = $25.00 • Each salesperson had to sell at least one complete rifle per month ($100) • The most one salesperson could sell in a month was 70 locks, 80 stocks, and 90 barrels • Each salesperson sent a telegram to the Missouri company with the total order for each town (s)he visits • 1≤towns visited≤10, per month • Commission: 10% on sales up to $1000, 15% on the next $800, and 20% on any sales in excess of $1800
  • 21. 21 Example Test Cases Using Output Range Values 80 90 60 60 70 72 40 22.2 33.3 Stocks Locks Barrels
  • 22. 22 Output Boundary Value Test Cases Case # Locks Stocks Barrels Sales Comm. Comments 1 1 1 1 100 10 min 2 10 10 9 975 97.5 border- 3 10 9 10 970 97 border- 4 9 10 10 955 95.5 border- 5 10 10 10 1000 100 border 6 10 10 11 1025 103.75 border+ 7 10 11 10 1030 104.5 border+ 8 11 10 10 1045 106.75 border+
  • 23. 23 Output Special Value Test Cases Case # Locks Stocks Barrels Sales Comm. Comment 1 10 11 9 1005 100.75 border+ 2 18 17 19 1795 219.25 border+ 3 18 19 17 1805 221 border+
  • 24. 11/11/2023 Random testing • Random testing is a black-box software testing technique where programs are tested by generating random, independent inputs. Results of the output are compared against software specifications to verify that the test output is pass or fail. • In case of absence of specifications the exceptions of the language are used which means if an exception arises during test execution then it means there is a fault in the program.
  • 25. Equivalence Classes • In mathematics, when a set has an equivalence relation defined on its elements, there is a natural grouping of elements that are related to one another, forming what are called equivalence classes. • An equivalence relation is a binary relation ~ satisfying three properties: • For every element a in X, a ~ a (reflexivity), • For every two elements a and b in X, if a ~ b, then b ~ a (symmetry) • For every three elements a, b, and c in X, if a ~ b and b ~ c, then a ~ c (transitivity). • The equivalence class of an element a is denoted [a] and is defined as the set • of elements that are related to a by ~. 11/11/2023
  • 26. 26 Equivalence Class Test Cases for the Triangle Problem • Outputs: Not a Triangle, Scalene, Isosceles, Equilateral • Easier to identify output (range) equivalence classes – R1 = {<a, b, c> : the triangle with sides a, b, and c is equilateral} – R2 = {<a, b, c> : the triangle with sides a, b, and c is isosceles} – R3 = {<a, b, c> : the triangle with sides a, b, and c is scalene} – R4 = {<a, b, c> : sides a, b, and c do not form a triangle} T e s tC a s e a b c E x p e c te dO u tp u t O E 1 5 5 5 E q u ila te ra l O E 2 2 2 3 Is o s c e le s O E 3 3 4 5 S c a le n e O E 4 4 1 2 N o taT ria n g le
  • 27. 27 Equivalence Class Test Cases for the Triangle Problem • Input (domain) equivalence classes D1 = {<a, b, c> : a = b = c} D2 = {<a, b, c> : a = b, a ≠ c} D3 = {<a, b, c> : a = c, a ≠ b} D4 = {<a, b, c> : b = c, a ≠ b} D5 = {<a, b, c> : a ≠ b, a ≠ c, b ≠ c} // D6 = {<a, b, c> : a ≥ b + c} D6’ = {<a, b, c> : a = b + c} D6’’ = {<a, b, c> : a > b + c} // D7 = {<a, b, c> : b ≥ a + c} D7’ = {<a, b, c> : b = a + c} D7’’ = {<a, b, c> : b > a + c} // D8 = {<a, b, c> : c ≥ a + b} D8’ = {<a, b, c> : c = a + b} D8’’ = {<a, b, c> : c > a + b}
  • 28. 28 University of Waterloo Equivalence Class Test Cases for the NextDate Function • Input variables – 1 ≤ month ≤ 12 – 1 ≤ day ≤ 31 – 1812 ≤ year ≤ 2012 • Traditional approach – Valid equivalence classes • M1 = { month : 1 ≤ month ≤ 12 } • D1 = { day : 1 ≤ day ≤ 31 } • Y1 = { year : 1812 ≤ year ≤ 2012 } – Invalid equivalence classes • M2 = { month : month < 1 } • M3 = { month : month > 12 } • D2 = { day : day < 1 } • D3 = { day : day >31 } • Y2 = { year : year < 1812 } • Y3 = {year : year > 2012 } C a s eID M o n th D a y Y e a r E x p e c te dO u tp u t T E 1 6 1 5 1 9 1 2 6 /1 6 /1 9 1 2 T E 2 - 1 1 5 1 9 1 2 in v a lidin p u t T E 3 1 3 1 5 1 9 1 2 in v a lidin p u t T E 4 6 - 1 1 9 1 2 in v a lidin p u t T E 5 6 3 2 1 9 1 2 in v a lidin p u t T E 6 6 1 5 1 8 1 1 in v a lidin p u t T E 7 6 1 5 2 0 1 3 in v a lidin p u t
  • 29. 29 Universi Equivalence Class Test Cases for the NextDate Function • Traditional approach is deficient because it “treats” the elements of a class at the valid/invalid level • Different approach: What must be done to an input date? M1 = { month: month has 30 days } M2 = { month: month has 31 days } M3 = { month: month is February } D1 = { day: 1 ≤ day ≤ 28 } D2 = { day: day = 29 } D3 = { day: day = 30 } D4 = { day: day = 31 } Y1 = { year: year = 1900 } Y2 = { year: 1812 ≤ year ≤ 2012 AND (year ≠ 1900) AND (year mod 4 = 0) } Y3 = { year: 1812 ≤ year ≤ 2012 AND (year mod 4 ≠ 0) } Not a perfect set of equivalence classes!!!
  • 30. 30 Equivalence Class Test Cases for the NextDate Function C a s eID M o n th D a y Y e a r E x p e c te dO u tp u t W E 1 6 1 4 1 9 0 0 6 /1 5 /1 9 0 0 W E 2 7 2 9 1 9 1 2 7 /3 0 /1 9 1 2 W E 3 2 3 0 1 9 1 3 in v a lidin p u t W E 4 6 3 1 1 9 0 0 in v a lidin p u t Weak equivalence class test cases Case ID Month Day Year Expected Output SE1 6 14 1900 6/15/1900 SE2 6 14 1912 6/15/1912 SE3 6 14 1913 6/15/1913 SE4 6 29 1900 6/30/1900 SE5 6 29 1912 6/30/1912 SE6 6 29 1913 6/30/1913 SE7 6 30 1900 07/01/1900 SE8 6 30 1912 07/01/1912 SE9 6 30 1913 07/01/1913 SE10 6 31 1900 ERROR SE11 6 31 1912 ERROR SE12 6 31 1913 ERROR SE13 7 14 1900 7/15/1900 SE14 7 14 1912 7/15/1912 SE15 7 14 1913 7/15/1913 SE16 7 29 1900 7/30/1900 SE17 7 29 1912 7/30/1912 SE18 7 29 1913 7/30/1913 Case ID Month Day Year Expected Output SE19 7 30 1900 7/31/1900 SE20 7 30 1912 7/31/1912 SE21 7 30 1913 7/31/1913 SE22 7 31 1900 08/01/1900 SE23 7 31 1912 08/01/1912 SE24 7 31 1913 08/01/1913 SE25 2 14 1900 2/15/1900 SE26 2 14 1912 2/15/1912 SE27 2 14 1913 2/15/1913 SE28 2 29 1900 ERROR SE29 2 29 1912 03/01/1912 SE30 2 29 1913 ERROR SE31 2 30 1900 ERROR SE32 2 30 1912 ERROR SE33 2 30 1913 ERROR SE34 2 31 1900 ERROR SE35 2 31 1912 ERROR SE36 2 31 1913 ERROR Strong equivalence class test cases
  • 31. SE 465/ECE 453 31 University of Waterloo Equivalence Class Test Cases for the Commission Problem • Input Domain Equivalence Classes – Lock • L1 = { lock: 1 ≤ lock ≤ 70 } • L2 = { lock: lock < 1 } • L3 = { lock: lock > 70 } – Stock • S1 = { stock: 1 ≤ stock ≤ 80 } • S2 = { stock: stock < 1 } • S3 = { stock: stock > 80 } – Barrel • B1 = { barrel: 1 ≤ barrel ≤ 90 } • B2 = { barrel: barrel < 1 } • B3 = { barrel: barrel > 90 }
  • 32. 32 Equivalence Class Test Cases for the Commission Problem Strong Input Domain Equivalence Class Test Cases Test Case locks stocks barrels sales com m ission SE1 35 40 45 3900 640 SE2 35 40 0 ERROR ERROR SE3 35 40 91 ERROR ERROR SE4 35 0 45 ERROR ERROR SE5 35 0 0 ERROR ERROR SE6 35 0 91 ERROR ERROR SE7 35 81 45 ERROR ERROR SE8 35 81 0 ERROR ERROR SE9 35 81 91 ERROR ERROR SE10 0 40 45 ERROR ERROR SE11 0 40 0 ERROR ERROR SE12 0 40 91 ERROR ERROR SE13 0 0 45 ERROR ERROR SE14 0 0 0 ERROR ERROR SE15 0 0 91 ERROR ERROR SE16 0 81 45 ERROR ERROR SE17 0 81 0 ERROR ERROR SE18 0 81 91 ERROR ERROR SE19 71 40 45 ERROR ERROR SE20 71 40 0 ERROR ERROR SE21 71 40 91 ERROR ERROR SE22 71 0 45 ERROR ERROR SE23 71 0 0 ERROR ERROR SE24 71 0 91 ERROR ERROR SE25 71 81 45 ERROR ERROR SE26 71 81 0 ERROR ERROR SE27 71 81 91 ERROR ERROR T e s t C a s e l o c k ss t o c k s b a r r e l ss a l e sc o m m i s s i o n W E 1 3 5 4 0 4 5 3 9 0 0 6 4 0 W E 2 0 0 0 E R R O R E R R O R W E 3 7 1 8 1 9 1 E R R O R E R R O R Weak Input Domain Equivalence Class Test Cases
  • 33. 33 Equivalence Class Test Cases for the Commission Problem • sales = 45 x locks + 30 x stocks + 25 x barrels • L1 = { <lock, stock, barrel> : sales ≤ 1000 } • L2 = { <lock, stock, barrel> : 1000 < sales ≤ 1800 } • L3 = { <lock, stock, barrel> : sales > 1800 } Output Range Equivalence Class Test Cases T e s t C a s e l o c k ss t o c k s b a r r e l ss a l e sc o m m i s s i o n O R 1 5 5 5 5 0 0 5 0 O R 2 1 5 1 5 1 5 1 5 0 0 1 7 5 O R 3 2 5 2 5 2 5 2 5 0 0 3 6 0
  • 34. 34 University of Waterloo Guidelines and Observations 1. The traditional form of equivalence class testing is generally not as thorough as weak equivalence class testing, which in turn, is not as thorough as the strong form of equivalence class testing 2. The only time it makes sense to use the traditional approach is when the implementation language is not strongly typed 3. If error conditions are a high priority, we could extend strong equivalence class testing to include invalid classes (e.g. commission problem) 4. Equivalence class testing is appropriate when input data is defined in terms of ranges and sets of discrete values. This is certainly the case when system malfunctions can occur for out-of-limit variable values
  • 35. 35 University of Waterloo Guidelines and Observations 1. Equivalence class testing is strengthened by a hybrid approach with boundary value testing. (We can “reuse” the effort made in defining the equivalence classes) (e.g. NextDate function) 2. Equivalence class testing is indicated when the program function is complex. In such cases, the complexity of the function can help identify useful equivalence classes, as in the NextDate function 3. Strong equivalence class testing makes a presumption that the variables are independent when the Cartesian Product is taken. If there are any dependencies, these will often generate “error” test cases, as they did in the NextDate function
  • 36. 36 University of Waterloo Guidelines and Observations 1. Several tries may be needed before “the right” equivalence relation is discovered, as we saw in the NextDate example. In other cases, there is an “obvious” or “natural” equivalence partition. When in doubt, the best bet is to try to second guess aspects of any reasonable implementation