Black box testing, equivalence partitioning, equivalence class partition, ECP, Boundary Value Analysis, BVA, ISTQB Foundation level, Manual Testing, Examples for Equivalence Partitioning, Examples for Boundary value analysis
2. @ 2016 Disha Srivastava
“Software testing techniques in which functionality of the
software under test (SUT) is tested without looking at
the internal structure or working of the software”
Black Box Testing is based on program requirements and product specifications
ISTQB
Foundation Level
Black Box Testing
Executable ProgramInput Output
3. @ 2016 Disha Srivastava
Black Box Testing just focuses on inputs and output as per
application specifications.
Black Box can be any application / software which needs to be tested.
e.g : an operating system like android, a website like facebook, an
application like MS Office or Skype or a bespoke solution
Black Box is also know as functional or behavioral testing
ISTQB
Foundation Level
Black Box Testing
4. @ 2016 Disha Srivastava
Where to use Black Box Testing :
It’s is used in the following stages of the software development life cycle:
Component Testing
Integration Testing (or IUT - integration unit testing)
Systems Testing (ST)
Systems Integration Testing (SIT)
User Acceptance Testing (UAT)
Assisting in the business verification and validation of the application – Operational
Acceptance Testing (OAT)
Black Box Testing can be used in any phase of project
ISTQB
Foundation Level
Black Box Testing
5. @ 2016 Disha Srivastava
What is typically included in Black Box Testing :
Black Box testing pack often contains large number of overall test
cases to cover testing of the following:
Business Rules
Business Process
Data Validation
Data Mapping
Key Mapping Validation
Filtering
Derived calculations
ISTQB
Foundation Level
Black Box Testing
6. @ 2016 Disha Srivastava
Types of Black Box Testing Techniques:
ISTQB
Foundation Level
Black Box Testing
Error Guessing
Cause-Effect Graphing
8. @ 2016 Disha Srivastava
o Exhaustive testing of every possible input value combinations is:
• Expensive
• Time consuming
o Equivalence Partitioning is an efficient technique to cut down
the test data sets and hence test cases to test the application
• Break set of test cases into sub-sets
• Choose representative values for each subset and ensure that we
test these.
• Each subset of tests is thought of as a partition between
neighbouring subsets or domains
ISTQB
Foundation Level
Equivalence Partitioning
9. @ 2016 Disha Srivastava
Equivalence class is a subset of data that falls into
categories where the system responds in a similar manner
Equivalence partitioning is a technique for testing
equivalence rather than undertaking exhaustive testing of
each value of the larger class
Equivalence partitioning also know as equivalence class partitioning (ECP)
ISTQB
Foundation Level
Equivalence Partitioning - Definition
10. @ 2016 Disha Srivastava
o Selects classes of inputs that will be expected to be handled in
the same way.
o Equivalence classes are identified based on the set of valid or invalid
states for each input condition. An input condition can be :
• A specific numeric value
• A range of values
• A set of related values
• A Boolean condition
o Within a group of data, a representative input can be selected
for testing
ISTQB
Foundation Level
Equivalence Partitioning – How to do it
11. @ 2016 Disha Srivastava
o If an input condition specifies a range, one valid and two
invalid equivalence class are defined
o If an input condition requires a specific value, one valid and
two invalid equivalence classes are defined
o If an input condition specifies a member of a set, one valid and
one invalid equivalence classes are defined
o If an input condition is Boolean, one valid and one invalid
classes are defined
[Pressman 2004]
ISTQB
Foundation Level
Equivalence Partitioning – Guidelines
13. @ 2016 Disha Srivastava
Requirement :
Program for computing grades based on the marks scored by students, where
the input variable is Marks. The rule of computing the grade is as follows:
ISTQB
Foundation Level
Equivalence Partitioning – Example 1
Marks Grade
100 – 90 A
89 – 80 B
79 – 70 C
69 – 60 D
59 – 0 F
For the exercise only consider integer years.
14. @ 2016 Disha Srivastava
Equivalence Classes :
•The input domain of Marks can be partitioned into 5 valid equivalence
classes and 2 invalid equivalence classes
• Valid classes: 0~59, 60~69, 70~79, 80~89, 90~100
• Invalid classes: smaller than 0 and greater than 100
• Any data value within a class is considered equivalence in terms of
testing
• Using the equivalence partitioning testing, we can reduce the test
cases from 100 (assume 0 <= score <= 100) to 7
ISTQB
Foundation Level
Equivalence Partitioning – Example 1
15. @ 2016 Disha Srivastava
Requirement :
“The customer is eligible for a life insurance discount if they are at least
18 and no older than 56 years of age.”
ISTQB
Foundation Level
Equivalence Partitioning – Example 2
For the exercise only consider integer years.
18 56
Invalid Partition
< 18
Invalid Partition
> 56
Valid Partition
Range 18 to 56
16. @ 2016 Disha Srivastava
Requirement :
“The customer is eligible for a life insurance discount if they are over 18
and less than 56 years of age.”
ISTQB
Foundation Level
Equivalence Partitioning – Example 3
For the exercise only consider integer years.
18 56
Invalid Partition
=< 18
Invalid Partition
> 56
Valid Partition
Range 19 to 56
People aged exactly 18 or exactly 56 would now not get a discount.
17. @ 2016 Disha Srivastava
Requirement :
• Customers must be at least 18.
• Customers are eligible for a life insurance discount of 40% if they are at least 18 and no older than 25
years of age.
• Customers are entitled to a 30% discount if they are older than 25 years of age, but under 40.
• Customers are entitled to a 10% discount if they are 40 or over, but no older than 56.
• Over 56 customers are not entitled to a discount.”
ISTQB
Foundation Level
Equivalence Partitioning – Example 4
For the exercise only consider integer years.
18 25
40% discount
40
10% discount
56
10% discount 0% discountInvalid <18
18. @ 2016 Disha Srivastava
Requirement :
“Eligible Age field on a form contains a text box which accepts numeric
values in the range of 18 to 26. Identify the invalid Equivalence class”
ISTQB
Foundation Level
Equivalence Partitioning – Example 5
For the exercise only consider integer years.
18 26
Invalid Partition
< 18
Invalid Partition
> 26
Valid Partition
Range 18 to 26
19. @ 2016 Disha Srivastava
Requirement :
“ Program edits credit limits within a given range ($10,000 - $15,000)”
ISTQB
Foundation Level
Equivalence Partitioning – Example 6
For the exercise only consider integer years.
$ 10,000 $ 15,000
Invalid Partition
< $10,000
Invalid Partition
> $ 15,000
Valid Partition
Range $ 10,000 to $ 15,000
20. @ 2016 Disha Srivastava
Requirement :
Flight reservation application
Ticket values [Number of tickets a user can book in single session] 1 to 10 are considered valid
& ticket is booked.
While value 11 to 99 are considered invalid for reservation and error message will
appear, "Only ten tickets may be ordered at one time.“
Identify valid/ invalid set
ISTQB
Foundation Level
Equivalence Partitioning – Example 7
For the exercise only consider integer years.
10
Valid Partition
No of tickets: 1 to 10
Invalid Partition
No of tickets: 11 to 99
1000
Invalid Partition
No of tickets > 99
Invalid Partition
No of tickets < 1
21. @ 2016 Disha Srivastava
Requirement :
• 3% rate of interest is given if account balance is in the range of $0 to $100
• 5% rate of interest is given if account balance is in the range of $100 to $1000
• 7% rate of interest is given if account balance is $1000 and above
Identify valid/invalid equivalence partitions
ISTQB
Foundation Level
Equivalence Partitioning – Example 8
For the exercise only consider integer years.
100
Valid Partition
Account balance 0 to 100
Valid Partition
Account balance 100 to 1000
10000
Valid Partition
Account balance >= 1000
Invalid Partition
Account balance < 1
22. @ 2016 Disha Srivastava
“
Boundary Value Analysis (BVA)
23. @ 2016 Disha Srivastava
o Based on testing experience, a large % of errors are found at the
boundaries of an input/output domain than in the “center”.
o In addition to select test data “inside” an equivalence class, data at the
“edges” of the equivalence class also need to be examined
o Boundary Value analysis (BVA)
• A test case design technique complements to equivalence partition
• Define boundary using equivalence partition
• Select of test cases that exercise bounding values (“edge” of the class)
ISTQB
Foundation Level
Boundary Value Analysis
24. @ 2016 Disha Srivastava
o Based on experience / heuristics
• Testing boundary conditions of equivalence classes is more effective
o Choose input boundary values as equivalence classes representatives
o Choose inputs that invoke output boundary values
o Boundary value
“A data value that corresponds to a minimum or maximum input, internal, or output
value specified for a system or component.”
o Examples:
[1, 10] ⇒ validate using 0, 1, 2, 9, 10, 11
ISTQB
Foundation Level
Boundary Value Analysis
Boundary Limit
Boundary Limit + 1Boundary Limit -1
25. @ 2016 Disha Srivastava
ISTQB
Foundation Level
Boundary Value Analysis – Example 1
Requirement : “Input condition has a range from a to b ( a = 20 to
b= 60).”
o BVA test cases, consider the following :
• Immediately below a (19)
• At a (20)
• Immediately above a (21)
• Immediately below b (59)
• At b (60)
• Immediately above b (61)
20 60
19 21 59 61
If significant digit was second decimal place, then the limits above would be +/- 0.01
26. @ 2016 Disha Srivastava
ISTQB
Foundation Level
Boundary Value Analysis – Example 2
Requirement :
“The customer is eligible for a life insurance discount if they are at least
18 and no older than 56 years of age.”
18 56
Invalid Partition
< 18
Invalid Partition
> 56
Valid Partition
Range 18 to 56
17 19 55 57
Boundary Values : 17, 18, 19 and 55, 56, 57
27. @ 2016 Disha Srivastava
Requirement :
• Customers must be at least 18.
• Customers are eligible for a life insurance discount of 40% if they are at least 18 and no older than 25
years of age.
• Customers are entitled to a 30% discount if they are older than 25 years of age, but under 40.
• Customers are entitled to a 10% discount if they are 40 or over, but no older than 56.
• Over 56 customers are not entitled to a discount.”
ISTQB
Foundation Level
Boundary Value Analysis – Example 3
For the exercise only consider integer years.
17, 18, 19 24, 25, 26
40% discount
38, 39, 40
10% discount
55, 56, 57
10% discount 0% discountInvalid <18
28. @ 2016 Disha Srivastava
Requirement :
• 3% rate of interest is given if account balance is in the range of $0 to $100
• 5% rate of interest is given if account balance is in the range of $100 to $1000
• 7% rate of interest is given if account balance is $1000 and above
Identify valid/invalid equivalence partitions
ISTQB
Foundation Level
Boundary Value Analysis – Example 4
For the exercise only consider integer amount.
99, 100, 101
Valid Partition
Account balance 0 to 100
Valid Partition
Account balance 100 to 1000
999, 1000, 1001-1, 0, 1
Valid Partition
Account balance >= 1000
Invalid Partition
Account balance < 1
29. @ 2016 Disha Srivastava
Requirement :
“Eligibility criteria for appearing for banking exams is that age of
candidate should be between 18 to 25 (not less 18 and no more 25)”
ISTQB
Foundation Level
Boundary Value Analysis – Example 5
For the exercise only consider integer years.
12
Invalid Partition
< 18
Invalid Partition
> 26
Valid Partition
Range 18 to 26
18 25 26
Boundary values: {17;18,19} {24;25;26}
30. @ 2016 Disha Srivastava
Requirement :
In a system designed for postal services' payment:
Letters up to 100g are called as ‘light’.
Postal rates for sending the light letters up to 10g are $25.
The next 40g should be played by $35.
Each next 25g up to 100g should be played by an extra $10.
Partitions should be designed for “grams”
Equivalence classes Boundary Values
0 – 9 g: 25$ {-1, 0, 1}, {8, 9, 10},
10-49 g: 35$ {9, 10, 11}, {48,49,50}
50-74 g:10$ {49, 50, 51}, {73,74,75}
75-99g: 10$ {74,75,99}, {98,99,100}
100+1g: not a light letters {99,100,101}
10/12
ISTQB
Foundation Level
Boundary Value Analysis – Example 6
31. @ 2016 Disha Srivastava
Requirement :
HR module : Hire the candidate or not, based on the age of the candidate:
0-16 (Do not Hire)
16-18 (Can hire only part time )
18-55 (Can hire on full time)
55-99(Do not Hire)
Equivalence classes Boundary Values
0-15: Do not Hire {-1, 0, 1}, {14, 15, 16},
16-17: Can hire only part time {17, 18, 19},
18-54: Can hire on full time {54, 55, 56},
55-99: Do not Hire {98, 99, 100}
10/12
ISTQB
Foundation Level
Boundary Value Analysis – Example 7
33. @ 2016 Disha Srivastava
o Identify potential errors and design test cases based on intuition and
experiences
o Test cases can be derived by making a list of possible errors or error-
prone situations
• Empty or null lists
• Zero instances or occurrences
• Blanks or null strings
• Negative numbers
• Historical defects
ISTQB
Foundation Level
Error Guessing
34. @ 2016 Disha Srivastava
“
“Bugs lurk in corners and congregate at
boundaries”
- Boris Beizer
Notas del editor
Can be applied to software “units” (e.g., classes) or to entire programs
External behavior is defined in API docs, Functional specs, Requirements specs, etc.