Boundary Value Analysis and Equivalence Partitioning explained with a simple example:
Boundary Value Analysis and Equivalence Partitioning are both test case design strategies in Black-Box Testing.
This tutorial will explain all about Boundary Value Analysis and Equivalence Partitioning in detail along with simple examples for your easy understanding.
Let’s start!!
Equivalence Partitioning
In this method, the input domain data is divided into different equivalence data classes. This method is typically used to reduce the total number of test cases to a finite set of testable test cases, still covering maximum requirements.
In short, it is the process of taking all possible test cases and placing them into classes. One test value is picked from each class while testing.
For example, if you are testing for an input box accepting numbers from 1 to 1000 then there is no use in writing thousands of test cases for all 1000 valid input numbers plus other test cases for invalid data.
Using the Equivalence Partitioning method above, test cases can be divided into three sets of input data called classes. Each test case is a representative of the respective class.
So in the above example, we can divide our test cases into three equivalence classes of some valid and invalid inputs.
Test cases for input boxes accepting numbers between 1 and 1000 using Equivalence Partitioning:
#1) One input data class with all valid inputs. Pick a single value from the range of 1 to 1000 as a valid test case. If you select other values between 1 and 1000, then the result is going to be the same. So one test case for valid input data should be sufficient.
#2) Input data class with all values below the lower limit. i.e., any value below 1, as an invalid input data test case.
#3) Input data with any value greater than 1000 to represent the third invalid input class.
So using Equivalence Partitioning, you have categorized all possible test cases into three classes. Test cases with other values from any class should give you the same result.
We have selected one representative from each input class to design our test cases. Test case values are selected in such a way that the largest number of attributes of equivalence class can be exercised.
Equivalence Partitioning uses the fewest test cases to cover the maximum requirements.
Boundary Value Analysis
It’s widely recognized that the input values at the extreme ends of the input domain cause more errors in the system.
More application errors occur at the boundaries of the input domain. ‘Boundary Value Analysis’ Testing technique is used to identify errors at boundaries rather than finding those that exist in the center of the input domain.
Boundary Value Analysis is the next part of Equivalence Partitioning for designing test cases where test cases are selected at the edges of the equivalence classes.
Test cases for input box accepting numbers between 1 and 1000 using Boundary value analysis:
#1) Test cases with test data exactly as the input boundaries of input domain i.e. values 1 and 1000 in our case.
#2) Test data with values just below the extreme edges of input domains i.e. values 0 and 999.
#3) Test data with values just above the extreme edges of the input domain i.e. values 2 and 1001.
Boundary Value Analysis is often referred to as part of Stress and Negative Testing.
Note: There is no hard-and-fast rule to test only one value from each equivalence class you created for input domains. You can select multiple valid and invalid values from each equivalence class according to your needs and previous judgments.
For example, if you divide 1 to 1000 input values invalid data equivalence class, then you can select test case values like 1, 11, 100, 950, etc. Same case for other test cases having invalid data classes.
This should be a very basic and simple example to understand the Boundary Value Analysis and Equivalence Partitioning concept.
Share your examples in the comments section below.
This side is very helpful,i would like to know wich sort of technical questions should you ask during the interview for Test analyst
Can any plz help out with worst test cases on BVA
yas sur i ca n help yoy please email me and i get right to yuo.
Pls send it to me also
Helpful
great …the way u express simple and meaningful
hi
>this is roma … i want your help… i want to know the test cases for Microsoft outlook 2007..i hope you will help me..
>i prepared test scenario which i mentioned below:-
>please help me…urgently
>thanks
>
>Ms. Roma
>
>1 Always BCC •Performs a CC or a BCC automatically for every email.
>•Customize the email messages that get CC’ed or BCC’ed.
>2 Attachment Reminder • Check your outgoing email for keywords and prompt you in case you
> forgot to attach a file.
>• Keywords are configurable.
>• Intelligently considers signature files.
>3 Attachment Save •Replaces attachments with links.
>•Reduces Outlook storage spaces.
>•Improve Outlook performance.
>•Delete the attachment when deleting an email.
>4 Duplicate Appointment Remover •Removes duplicate appointments.
>•Customizable
>•Fast
>5 Duplicate Contact Remover •Removes duplicate contacts.
>•Customizable
>•Fast
>6 Duplicate Email Remover •Remove duplicate emails in Microsoft Outlook.
>•Customizable
>•Fast
>7 Duplicate Note Remover •Delete duplicates or move them to a folder.
>•Comparisons of two appointments based on subject, body and color.
>•Works with a single folder or multiple folders at once.
>8 Duplicate Task Remover •Delete duplicates or move them to a folder.
>•Comparisons of two tasks based on subject, due date, categories,
> contacts, company, body and start date.
>•Works with a single folder or multiple folders at once.
>•Works with Microsoft Outlook 2013, Outlook 2010 and Outlook 2007.
>9 Follow Up Reminder •Reminds you if you have not heard back from someone.
>•List all your pending reminders with a click of a button.
>•Add follow up reminders to any email in any Outlook folder.
>•Quick Snooze.
>10 Remove Subject Prefix •Remove redundant ‘Re:’, ‘Fw:’ etc. from message subjects.
>11 Reply To All •Prompts you when you reply to everyone. Avoid sending out information
> you may not want to share with everyone.
>• Prevent Outlook from including your name and email address in a reply to all message thus avoiding extra copies.
>• Prompts with a confirmation message if you were BCC’ed on the
> message.
>12 Save as PDF •Saves all your emails as PDF files.
>•Saves attachments as PDF files.
>•Save the emails on receipt or batch mode.
>•No other PDF printer driver needed.
>13 Send Individually •Sends email marketing to each of your recipients, one at a time.
>•Adds a convenient “Send Individually” Outlook button.
>•Easily handles distribution lists, contact groups, and Excel lists.
Good post, I have to say the Equivalence Partitioning technique has saved me from writing and executing a large number of unnecessary tests.
very clear and simple explanation thnku so much
Hi,
I want to know whether I have written correct ECP and BVA values for the condition if(a>b) and both are of type INT32 .
a>b Valid class
a==b Invalid class
a<b Valid class
and values are like b,b+1,b-1,minium and maximum and in the ECP can we change the both variable value or we should keep one as a constant to have good ECP
Please help me .
Thanks
Hi,
I want to know whether I have written correct ECP and BVA values for the condition if(a>b) and both are of type INT32 .
a>b Valid class
a==b Invalid class
a<b Invalid class
and values are like b,b+1,b-1,minium and maximum and in the ECP can we change the both variable value or we should keep one as a constant to have good ECP
Please help me .
Thanks
Awesome explanation for Boundary value Analysis and Equivalence Class partitioning. Easy to understand.
Thanks a ton for the clear explanation.
could you please give real time examples of BVA and ECP considering any web application like yahoo mail.
Very Useful.. thanks for posting
Simple & Useful..
Good one!
my question is
what is BVA and ECP value for -1 to 1022 range
-2 1023,-1 1022,0 1023
sorry its -2 1021, -1 1022, 0 1023
Don’t Forget “Testing is Context Dependent”.
-2 -1 0 1021 1022 1023
Really its good. .
How to write BVA for Date range .
Suppose a field take data between following date range then how to write BVA
Date: 1 Jan 2014 to 31 March 2014
Please help me.
I guess its 31 Dec 2013 – 30 Mar 2014, 1 Jan 2014 – 31 Mar 2014, 2 Jan 2014 – 1 April 2014
31 Dec 2013 will be a invalid input data then how would u test from 31 Dec 2013 – 30 Mar 2014. please help me to get it.
Dear Frnds
pl help me how to write test cases for regristration form of any website
Nice and Easy to learn….to understand easy…tanKQ…
This kind of Articles helps every one especially freshers
great artical,It makes me to understand very easy.
Good article…
Thanks lot
Nice article with very gud examples. Thanks a lot to Vijay for the support.
Hi,
Can someone help me to write BVA(Boundary Value Analysis) for input field that accepts only 10 digit Phone numbers? What will be the boundary numbers?
test case 1: Invalid if digits >=11 (example 98765432101)
test case 2: valid if digits =10 (example 1234567890)
test case 3:invalid if digits <=9 (example 123456789)
Really thanks for the help.. It will be helpful in my mid semester exam..
Hello Everybody,
I have one doubt Regarding boundary value analysis and Equivalent class partitioning.
Let I have one Test cases for input box accepting numbers between 1 and 1000.
So as we know through boundary value analysis and Equivalent class partitioning we can check min value i.e. 0,1,2 and max value i.e 999,1000,1001.
But user may give some random number like 55,555555,45566,289 and So on.
So,My doubt is how we can check that number is valid or not ?
Thanks for sharing………
Nice questions for brushing before exam.
Hi Friends ,
Could anyone be kind enough to send me questions or dumps with answers for ISTQB Fundamental Certification . I am appearing For ISTQB certification exam next week.
kskadian@yahoo.com
Thanking you all in anticipation.
Kavita
@Kavita and all
If you want free ISTQB foundation level exam material you can get it from below page by registering with your email.
You will get some sample papers over the period of couple of weeks through this option:
Softwaretestinghelp.com/istqb-free-updates/
If you are interested in premium sure-pass study guide to easily pass and score high in this exam please check this study guide:
Softwaretestinghelp.org/istqb-certification-complete-study-package/
hey thanx alot i was searching alot notes for exam
i have doubt regarding Test Matrices , Test Metrics, & Test matrix can u pls explain tis
valuable info
So, in the equivalence class test cases for numbers from 1 to 1000, since there are only three test cases, do we also perform only three tests, or do we still need to perform 1000 tests? If we are supposed to perform only three tests, then how can we be sure that every single number gives the same result? Maybe the software has a bug that gives a different result for 99.
You Rock Dude Awesome
Thank you very much,its very helpful one …..!
Hi all,this article is really good,thank you very much for sharing
I have some confusion between ecp and bva,both are looking same,in ecp we cover bva also,please can anyone explain with example
Dear,
Any one tell me the correct formula for boundary value analysis
BV = LV-1, LV, LV+1, UV-1, UV, UV+1.
BV = LV-1, LV+1, UV-1,UV+1.
Can anyone help me out on below questions:
Below you will find the requirements to identify the Account Diversity Grade of a user. Read the
requirements carefully and identify what test users you need to setup in order to completely
test and make sure all the below requirements are covered. (Note: you should identify the
optimum (minimum) number of users needed to test all of the requirements)
Requirements:
A user can have different types of loan accounts. Now we grade a user’s Account Diversity based
on two factors.
1) loanTypeCount
2) totalAccounts
loanTypeCount = the number of different (distinct) LoanType values for all accounts that the
user has.
However do not include LoanType = Unknown & Collections but include all others
Applicable values for LoanType are ( Home Loan, Heloc, Credit Card, Car Loan, Collections,
Unknown)
totalAccounts = total number of loan accounts user has (do not include LoanType = Unknown &
Collections but include all others)
example-> if user has 3 credit cards and 2 home loans and 1 Collection account, then
totalAccounts = 5 and loanTypeCount = 2)
The logic to determine accountDiversityGrade is the following:
If totalAccounts> 20 or loanTypeCount >= 4, accountDiversityGrade = A
Else if totalAccounts> 10 or loanTypeCount = 3, accountDiversityGrade = B
Else if totalAccounts>= 5 or loanTypeCount= 2, accountDiversityGrade = C
Else if totalAccounts > 0 or loanTypeCount = 1, accountDiversityGrade = D
Else accountDiversityGrade=null (n/a)
Really a useful and valid info. Thanks
can anyone let me know how to perform BVA incase of decimals.. like,, if range is like +(or)- 999.99
Assume that a Login page of yahoo mail accepts valid user ID and Password field. User ID field accepts minimum 10 characters and maximum 15 characters. Valid range 10-25,
Invalid range 9 or less than 9 and Invalid range 26 or more than 26.
Considering the above scenario you are required to implement boundary value analysis and write down the Test Cases for all partitioned values (Valid, Invalid and exact boundary).
Invalid Partition Valid Partition Invalid Partition
Test Cases:
If we have four fields like name, phone number, city and state then how many total number of test cases are required ? Please advise. Thank you…
Nice one, Thanks for Sharing !
May be we need to correct one small typo in example :
Updated statement :
For Example, if you divided 1 to 1000 input values in a valid data equivalence class, then you can select test case values like 1, 11, 100, 950, etc. Same case for other test cases having invalid data classes.
very helpful and simple article
d. Boundary Value Analysis for Decimal Number, and Binary Number.
Great article with simple example