Understand this situation 1…
• Equivalence classes are chosen for valid and invalid inputs
– If a value x is defined as 0 ≤ x ≤ 100, then we can initially identify
three equivalence classes:
1. x < 0
(invalid input values)
2. 0 ≤ x ≤ 100 (valid input values)
3. x > 100
(invalid input values)
– Further invalid EC can be defined, containing, but not limited to:
non-numerical inputs,
numbers too big or too small,
non-supported format for numbers
<0
0..100
> 100
All possible test case and test data for situation 1
IF Value >= 0 AND Value <= 100 THEN ….
101
0
1
-1
OUT OF
RANGE
37
19
65
48
53
IN RANGE
99
87
100
1000
OUT OF
RANGE
How many EC?
• If a limitation specifies the area of validity:
One valid and two invalid equivalence classes.
– In the specification of the test object, it is defined
that integer input values from 1 to 100 are
possible.
– Area of validity: 1 <= x <= 100
– Valid class: 1 <= x <= 100
– Invalid classes: x <1 as well as x >100
How many EC?
• If a limitation specifies a minimal and a maximal
amount of values: One valid and two invalid
equivalence classes.
– Specification: A member of the sports club has to register
himself with at least one type of sport. Every member can
only be registered actively in a maximum of three types of
sport.
– Valid class: 1 <=x <=3 (1 to 3 sports)
– Invalid classes:
• x = 0 (no allocation to a sport)
• x > 3 (allocated to more than 3 sports)
How many EC?
• If a limitation specifies an amount of values, which
possibly will be treated differently: For each of this
amount an own valid equivalence class an in addition to
that all together one invalid equivalence class.
– Specification: The sports club offers following sports: Football,
Hockey, Basketball and Volleyball.
– Valid classes:
•
•
•
•
Football
Hockey
Basketball
Volleyball
– Invalid classes: anything else e.g.: Badminton
How many EC?
• If a limitation specifies a situation, which must be
met mandatory: One valid and one invalid
equivalence classes.
– Specification: Every member of the sports club received a
unique member ID. It starts with the first letter of the
family name of the member.
– Valid class:
• First digit is a letter.
– Invalid class:
• First digit is not a letter.
Exercise 1: Combination ECs
• The percentage value will now be displayed in a bar chart.
The following additional requirements apply (both values included):
– values between 0 and 15:
– values between 16 and 50:
– values between 51 and 85:
– values between 86 and 100:
grey bar,
green bar,
yellow bar,
red bar.
• Now there are four instead of one valid equivalence classes:
– 1st
– 2nd
– 3rd
– 4th
<0
valid equivalence class:
valid equivalence class:
valid equivalence class:
valid equivalence class:
0..15
16..50
51..85
0 ≤ x ≤ 15
16 ≤ x ≤ 50
51 ≤ x ≤ 85
86 ≤ x ≤ 100
86..100
> 100
EP – picking representatives
• On a last step, one representative of each EC is
determined as well as the result to be
expected for it
Variable
Equivalence class
percentage value
(valid)
EC1: 0 ≤ x ≤ 15
+10
EC2: 16 ≤ x ≤ 50
+20
EC3: 51 ≤ x ≤ 85
+80
EC4: 86 ≤ x ≤ 100
+90
EC5: x < 0
–10
EC6: x > 100
+200
percentage value
(invalid)
Representatives
EC7: x no integer
1,5
EC8: x non numeric
fred
Exercise 2: Combination ECs
• A savings account in a bank earns a different rate of
interest depending on the balance in the account. In
order to test the software that calculates the interest
due, we can identify the ranges of balance values that
earn the different rates of interest. If a balance in the
range $0 up to $100 has a 3% interest rate, a balance
over $100 and up to $1000 has a 5% interest rate, and
balances of $1000 and over have a 7% interest rate
• Find the Equivalence Partitioning for the above
software
Exercise 3: Combination ECs
• Certain defects might possibly remain undetected if different invalid
equivalence classes are combined in the same test case!
• Example
– Input Value 1 <= value <= 99; colour IN (red, green, yellow)
• Equivalence Classes
– value_VP1: 1 <= value <= 99
– value_IP1: value < 1
– value_IP2: value > 99
– colour_VP1: colour IN (red, green, yellow) e.g. red
– colour_IP1: NOT colour IN (red, green, yellow) e.g blue
• Test data value=0, colour=blue -> value_IP1 and colour_IP1
• ⇒ Any defective treatment of colour=blue maybe remain undetected
Exercise 3: Combination ECs
• A piece of code computes the price of a product based on its
value, a discount in % and shipping costs (6, 9 or 12 RM,
depending on shipping mode)
• Requirements:
Value of goods is given as a positive number with 2 decimal
places
Discount is a percentage value without decimal places
between 0% and 100%
Shipping costs can only be 6, 9 or 12
Derive the EP class and representative values for each
class.
Exercise 3: Combination ECs
Variable
Equivalence Class
Value of
goods
EC11: x >= 0.00
valid
1000.00
EC12: x < 0.00
invalid
–1000.00
EC13: x non-numerical value
invalid
fred
valid
10%
EC22: x < 0%
invalid
–10%
EC23: x > 100%
invalid
200%
EC24: x non-numerical value
invalid
fred
EC31: x = 6
valid
6
EC32: x = 9
valid
9
EC33: x = 12
valid
12
EC34: x {6, 9, 12}
invalid
4
EC35: x non-numerical value
invalid
fred
Discount
Shipping
costs
EC21: 0% x 100%
Status
Representative
•
•
All test cases:
10 test cases are derived: 3 positive (valid values) and 7 negative (invalid values) test cases:
Variable
Value of
goods
Discount
Shipping
costs
Status
Representa
ntive
valid
1000
invalid
–1000.00
invalid
fred
valid
10%
invalid
–10%
invalid
200%
invalid
fred
valid
6
valid
9
valid
12
invalid
4
invalid
fred
T01
T02
T03
T04
T05
T06
T07
T08
T09
Expected Output
Price
Error Message
Actual Output
Price
Error Message
Pass / Fail
906
"Invalid
Shipping
costs"
T10
• Test cases for valid EC:
– Valid equivalence classes provide the following combinations or test cases: T01,
T02 and T03
Variable
Equivalence Class
Value of goods EC11: x >= 0
Discount
Shipping costs
Status
Representativ
e
valid
1000.00
EC12: x < 0
invalid
–1000.00
EC13: x non-numerical value
invalid
fred
valid
10%
EC22: x < 0%
invalid
–10%
EC23: x > 100%
invalid
200%
EC24: x non-numerical value
invalid
fred
EC31: x = 6
valid
6
EC32: x = 9
valid
9
EC33: x = 12
valid
12
EC34: x {6, 9, 12}
invalid
4
EC35: x non-numerical value
invalid
fred
EC21: 0% x 100%
T01
T02
T03
• Test cases for invalid EC:
– The following test cases were created using the invalid EC, each in combination with valid
ECs of other elements:
Variable Equivalence Class
Value of
goods
Discoun
t
Status
Representat
ive
EC11: x >= 0
valid
1000,00
EC12: x < 0
invalid
–1000,00
EC13: x non-numerical
value
invalid
fred
EC21: 0% x 100%
valid
10%
EC22: x < 0%
invalid
–10%
EC23: x > 100%
invalid
200%
EC24: x non-numerical
value
invalid
fred
valid
6
valid
9
valid
12
EC34: x {6, 9, 12}
invalid
4
EC35: x non-numerical
value
invalid
fred
Shipping EC31: x = 6
costs
EC32: x = 9
EC33: x = 12
T0
4
T0
5
T0
6
T0
7
T0
8
T0
9
T1
0
Exercise 3: Combination ECs
• choosing representatives
–any value within the EC can be a representative. Optimal are:
• typical values (used often)
• problem values (suspected failures)
• boundary values (on the edge of the EC)
Representatives of valid EC may be combined
Representatives of invalid EC may not be combined
Representatives of invalid EC may only be combined with valid
representatives of other EC
For test cases, representatives of invalid EC should be combined with
always the same values of other valid EC (standard combinations)
Choosing representatives implies that the function within the program
uses compare operations
Boundary Value Analysis (BVA)
• In combination with EP:
– Testing the borders of the equivalence class (highest and
lowest value)
– Every boundary of an equivalence class must be in a test
data combination.
• BVA operates on the basis that experience shows us
that errors are most likely to exist at the boundaries
between partitions and in doing so incorporates a
degree of negative testing into the test design
• 100% coverage of EP
• As with EP, it can be used for all Test levels
• Remember the ‘circle’ rule – INSIDE/OUTSIDE
Exercise BVA 1
• “How many items would you like to order?”
Exercise BVA 2
Exercise BVA 3
• Password (6-10 character alphanumeric)
Exercise BVA 4
• Enter the departure date for your flight
(MM/DD/YY)
Exercise BVA 5
• Enter the departure time for your flight:
(HH:MM:SS)
Exercise BVA 6
• Enter a bid price (under $1000)
Exercise BVA 7
• You are testing an e-commerce site that sells Omninet knick-knacks
like baseball caps, jackets, etc. Please refer to Figure 1 for a screen
snapshot. Create functional test for accepting orders:
– The system accepts a five-digit numeric item ID numbers from 00000 to 99999.
– Item IDs are sorted by price, with the cheapest items having the lower (close to
00000) item ID numbers and the most expensive items having the higher (close
to 99999) item ID numbers.
– The system accepts a quantity to be ordered, from 1 to 99.
– If the user enters a previously-ordered item ID and a 0 quantity to be ordered,
that item is removed from the shopping cart.
– The maximum total order is $999.99.
• Use boundary value analysis and equivalence class partitioning to
create tests
Exercise 8
Consider the following scenario.
If you take a train before 9:00 am or in the evening after 5:00 pm until 6.30
pm (the rush hour), you must pay full fare. A saver ticket is available for trains
between 9.00 am and 5.00 pm, and after 6.30 pm. The first train departs from
KL Sentral at 5 am and the last train is at midnight.
• What are the partitions and boundary values to test the train times for
ticket types?
• Which are valid partitions and which are invalid partitions?
• What are the boundary values?
• Derive test cases for the partitions and boundaries (please show this in
two separate tables)
© Copyright 2026 Paperzz