Skip to main content
1
Design test case technique
Equivalence partitioning
And Boundary value analysis
Estimated Time: 120 mins
Trainer: Tran Thanh Tuan
At the end of this course, you are
going to know:
To provide an approach to design test
case.
Understand how to apply equivalence
partitioning and boundary to design
test case.
PurposePurpose
1.Introduction
2.What is equivalence partitioning?
3.Identify equivalence classes
4.Define the test cases
5.Combining with boundary analyze to
choose data
6.Examples
7.Q&A
OutlineOutline
IntroductionIntroduction
Google search :
how many test cases
do we need?
Advantages of EPAdvantages of EP
- To reduce the number of test cases to a
necessary minimum
- To select the right test cases to cover all
possible scenarios ( of course not to be
absolutely sure)
What is EP?What is EP?
Input, output
domain
Equivalence
classes
How to use to design testcaseHow to use to design testcase
Test case design by EP proceeds into 2 steps:
- Identify equivalence classes
- Define the test cases
1. Introduction
2. What is equivalence partitioning ?
3. Identify equivalence class
4. Define the test case
5. Combining with boundary analyze to
choose data
6. Examples
7. Q&A
OutlineOutline
• Input, output: clue from requirement
• Equivalence classes are of 2 types: valid and
invalid
• Ex: identify equivalence classes for this
requirement “ if a pupil has total score >= 75,
he will pass the exam, otherwise will fail
(total score is an integer)”
Identify equivalence classesIdentify equivalence classes
Identify equivalence classesIdentify equivalence classes
Total score Error messageSystem
Fail
Pass
Valid equivalence
classes
Invalid
equivalence
classes
Total score 1. >=75 2. <75
3. Null
4. String
Result of the
exam
5. Pass
6. Fail
7. Error message
Identify equivalence classesIdentify equivalence classes
1. Introduction
2. What is equivalence partitioning ?
3. Identify equivalence class
4. Define the test case
5. Combining with boundary analyze to
choose data
6. Examples
7. Q&A
OutlineOutline
• Assign a unique number to each equivalence class
• For valid case: until all valid equivalence classes have
been covered by test case, write a new test case
covering as many uncover valid equivalence
classes as possible.
• For invalid case: until all invalid equivalence classes
have been covered by test case, write a new test case
that cover one, and only one, of the uncovered
invalid equivalence classes.
Define test casesDefine test cases
• Example: write test case for “ if a pupil has total score >= 75,
he will be past the exam, otherwise will fail ”, using
equivalence partitioning.
Define test casesDefine test cases
Conditions Valid
equivalence
class
Invalid
equivalence
class
Total score 1. >=75 2. <75
3. Null
4. String
Result of the
exam
5. Pass
6. Fail
7. Error
message
Test
case:
• 1, 5
• 2, 6
• 3, 7
• 4, 7
1. Introduction
2. What is equivalence partitioning?
3. Identify equivalence classes
4. Define the test cases
5. Combining with boundary analyze to choose
data
6. Examples
7. Q&A
OutlineOutline
Boundary analyze and EPBoundary analyze and EP
What is Boundary analyze?
- Is a technique to refine
equivalence partitioning
- Concentrate on cases at the
extreme ends of each
equivalence class.
Boundary analyze and EPBoundary analyze and EP
Boundary values
Boundary analyze and EPBoundary analyze and EP
Boundary value analysis?
- Is to use input variable value at the
minimum, just above minimum, just below
minimum, normal, at the maximum, just
below maximum, just above maximum
Boundary analyze and EPBoundary analyze and EP
Example:
• “ if a pupil has total score >= 75, he will pass the exam, otherwise will
fail (total score is an integer)”
Conditions Valid
equivalence
classes
Invalid
equivalence
classes
Total score 1. >=75 2. <75
3. Null
4. String
Result of
the exam
5. Pass
6. Fail
7. Error
message
Test
case:
1. 1, 5
2. 2, 6
3. 3, 7
4. 4, 7
Data to test:
1a. 75, pass
1b. 76, pass
2. 74, fail
3. Null, error
message
4a. A, error
message
4b. I am a tester of
EW and I love
this job, error
message
1. Introduction
2. What is equivalence partitioning?
3. Identify equivalence classes
4. Define the test cases
5. Combining with boundary analyze to choose
data
6. Examples
7. Q&A
OutlineOutline
1. Login function
- Requirement:
The Registered User enters credentials – a username
and password – and submits the credentials.
The System verifies the user’s credentials.
The System presents the homepage with hello user name and
log out link.
If the user has been inactive, the system presents a
message indicating that the account has been inactive.
If invalid username or password, the system determines that
the combination of username and password is in error.
( username: maximum 25 chars, not have space, unique, a-z,
A-Z, number, password: minimum 6 chars long)
ExamplesExamples
ExamplesExamples
Database
Homepage
System
Password
Username
Button
Submit
Error message of
username or
password is
incorrect
Error message of
inactive account
Nothing happen
Relation of
username
and
password
• Identify equivalence class:
ExamplesExamples
• Identify test case
Valid case
– 1,2,3,4,5,12,13,14,18,20,21,24,27
– 1,2,3,4,12,13,14,18,20,21,25,27
Invalid case
– 1,6,12,13,14,19,22,21,24,28
– 7,12,19,22,21,25,28
– 8,4,5,14,19,22,21,25,28
– 9,1,2,3,4,12,18,20,21,24,29
– 10,14,18,22,21,24,28
– 11,13,19,21,22,24,28
– 1,3,4,15,19,20,23,25,28
– 1,3,4,16,19,20,24,28
– 1,3,4,17,19,20,24,28
– 1,3,4,12,13,18,25,26,30
ExamplesExamples
1. Search function
- Requirement:
User fill in search field then click search. The system
will find all search string in the document and
highlight them.
If no one is found, message on form to indicate no
result found.
( search like Notepad)
ExamplesExamples
ExamplesExamples
Relationship
of search
text and
search data
Search
Search data
Search text
Message
indicates that no
search found
Highlight all the
occurrences of the
search text in the
search data
Nothing happen
Button
Search
Relationship
of search
text and
button
Search
• Identify equivalence class:
ExamplesExamples
• Identify test case
Valid case
– 1,10,12,13, 17,21,22
– 2,10,12,14,18,21,25
– 3,4,5,6,7,8,10,12,14,17,21,25
Invalid case
– 9,21
– 3,4,8,11,12,17,21,24, 26
– 3,6,7,10,13,15,18,21,22
– 3,10,12,14,19,20,23
ExamplesExamples
One page summaryOne page summary
• To provide an approach to design test
case 
• Understand how to apply equivalence
partitioning and boundary analysis to
design test case 
PurposePurpose
1. Introduction
2. What is equivalence partitioning?
3. Identify equivalence classes
4. Define the test cases
5. Combining with boundary analyze to choose
data
6. Examples
7. Q&A
OutlineOutline
Q&AQ&A
ReferencesReferences
• The art of software testing
• Internet
Thank you!!!