Software Testing: Equivalence Class Partitioning - Lecture Notes, Lecture notes of Software Engineering

Software Testing Lecture Slides

Typology: Lecture notes

2020/2021

Uploaded on 07/03/2021

muhammad-haris-15
muhammad-haris-15 🇵🇰

6 documents

1 / 21

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Chapter 5:
Dynamic Analysis-Test Design Techniques
Software Testing
Lecture 3
Equivalence Class Portioning
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15

Partial preview of the text

Download Software Testing: Equivalence Class Partitioning - Lecture Notes and more Lecture notes Software Engineering in PDF only on Docsity!

Chapter 5:

Dynamic Analysis-Test Design Techniques

Software Testing

Lecture 3

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

  • Can be applied to software “units”
  • External behavior is defined in functional requirements

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”