













Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Software Testing Lecture Slides
Typology: Lecture notes
1 / 21
This page cannot be seen from the preview
Don't miss anything!














Equivalence Class Portioning
Agenda for Today
Black Box Testing
Black Box Testing Example
Black Box Testing Techniques
Equivalence Class Partitioning
Equivalence Class Partitioning with Examples
Advantages and disadvantages of ECP
Positive and Negative Testing
Black Box Testing
Testing software without knowledge of internal implementation details
Focus on input and output
Examines the functionality of an application
Checks for valid and invalid conditions / inputs
Finds defects like: Incorrect functions, errors in data
structures, behaviour, initialization etc.
The Goal: Derive sets of input conditions (test cases) that fully exercise the
external functionality
Black Box Example 1
Functionality What you need to know how to use
Features of a lock Made of metal and ????
Features of a key Made of metal and ???
Actions performed Key inserted
States Locked and ???
Inputs Key turned clockwise or?
Expected outcome Locking
Unlocking
Black Box Techniques
Equivalence Class Partitioning
Motivation:
Complete testing
(^) Avoid test redundancy
Equivalence class partitioning:
(^) Black box testing technique
(^) Partitions are frequently derived from the requirements
Inputs to the software are divided into groups that are expected to exhibit similar
behavior.
Selecting one input from each group to design the test case.
(^) Can be used at any level of testing
Equivalence Partitioning = Equivalence Class Partitioning = ECP
Equivalence Class Partitioning
Partitions of the input set
Entire input set is covered
Disjoint classes
(^) Test cases
(^) Equivalence classes have to be chosen wisely
(^) All possible test cases is so large
(^) Select a relatively small number of test cases
(^) Which test cases should you choose?
-Equivalence Classes
Equivalence Class Partitioning
First level portioning: valid vs Invalid input/data
Equivalence Class Partitioning
Create a test case for atleast one value from each equivalence class
Equivalence Class Partitioning
Different definitions of test cases
- Example: int Add(n1,n2,n3,etc)
Equivalence Class Partitioning
Example 2
Equivalence Class Partitioning
Example 3
Pizza order application
Requirements:
Pizza values 1 to 10 is considered valid. A success message is shown.
While value 11 to 99 are considered invalid for order and an error message will
appear, "Only 10 Pizza can be ordered“
Test Conditions and Partitions:
Any Number greater than 10 entered in the Order Pizza field(let say 11) is considered invalid.
Any Number less than 1 that is 0 or below, then it is considered invalid.
Numbers 1 to 10 are considered valid
Any 3 Digit Number say 100 is invalid.
Equivalence Class Partitioning
Example 3
Pick only one value from each partition for testing
Equivalence Class Partitioning
Example 3
Table. Equivalence partitioning for Pizza order application
S# Equivalence Partition Type of Input
Test
Data
Expected Result
1 Number 1-10 Valid 10
“Successfully
Ordered 3 Pizza”
2 Number < 1 or 0 Invalid -1 “Invalid Order”
3 10<Number<=99 Invalid 88
“Only 10 Pizza can
be ordered”
4 Number>100 Invalid 121
“Only 10 Pizza can
be ordered”