Boundary value analysis and Equivalence partitioning, explained with simple example:
Boundary value analysis and equivalence partitioning both are test case design strategies in black box testing.
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.
E.g.: If you are testing for an input box accepting numbers from 1 to 1000 then there is no use in writing thousand test cases for all 1000 valid input numbers plus other test cases for invalid data.
Using equivalence partitioning method above test cases can be divided into three sets of input data called as classes. Each test case is a representative of respective class.
So in above example we can divide our test cases into three equivalence classes of some valid and invalid inputs.
Test cases for input box accepting numbers between 1 and 1000 using Equivalence Partitioning:
1) One input data class with all valid inputs. Pick a single value from range 1 to 1000 as a valid test case. If you select other values between 1 and 1000 then result is going to be same. So one test case for valid input data should be sufficient.
2) Input data class with all values below lower limit. I.e. any value below 1, as a invalid input data test case.
3) Input data with any value greater than 1000 to represent 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 every input class to design our test cases. Test case values are selected in such a way that largest number of attributes of equivalence class can be exercised.
Equivalence partitioning uses fewest test cases to cover maximum requirements.
Boundary value analysis:
It’s widely recognized that input values at the extreme ends of input domain cause more errors in system. More application errors occur at the boundaries of input domain. ‘Boundary value analysis’ testing technique is used to identify errors at boundaries rather than finding those exist in center of input domain.
Boundary value analysis is a 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 input domain i.e. values 2 and 1001.
Boundary value analysis is often called as a 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.
E.g. if you divided 1 to 1000 input values in 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.
This should be a very basic and simple example to understand the Boundary value analysis and Equivalence partitioning concept.
Share your examples below.



62 comments ↓
Nice…
Thanx….
Hi ,
Thanks for updating me.
Can u please hepl me about the certification in Testing as i planning to write.
First i need what is the Use of this certifications
Greate article……
Thank u….
hi vijay,
It’s a very good article. Thanks for sharing knowledge.
Regards,
Deepa
I would like to add one formulae here for boundary value.
n, n+1, n-1 one can use this formulae to calculate BV. It can be used for min and max value. As in the above example. 1-1000
BV= 1,2,0 and 1000,1001,999
Regards
kishore
nice one…
www.funandknowledge.blogspot.com
Very good explanations
dhinesh
grdhinesh@gmail.com
This kind of Articles helps every one. Good Work.
hi friends can anybody explain about traceability in detail with detail,,matrix
hi friends can anybody explain about traceability matrix in detail with example
Hi Vijay,
Thanks to Sharing knowledge
Regards
Manoj Upadhyay
Hi Friends ,
Can anybody tell me For I.s.t.Q.B Certification and is it indispensible condition to have atleast 2 yr. exp. in mannual My mail is is :-
Er4testing@yahoo.com
Thanks In Advance
Regards
manoj upadhyay
Hi!
Nice Way to explain with simple example. Keep the good work coming.
Why we have to methods to test the same condition.. Is it intenstional ?
Senthil
Using Equivalence partition:
you can divide input data into different class as valid and invalid class
eg: 1-1000
valid class-1-1000
Invalid class-less than 1
invalid class-more than 1000
Using BV: now using the above class you write your test cases on boundaries. you can use above formulae posted in my comment to find the boundary values for diffrenet classes.
Both the techniques are used simultaneously to design test case.
First you divide your input data into valid and invalid class using Equivalence partioning and
Second use boundary value to decide on the boundaries of each class.
Regards
kishore
Hi to every one,
This kind of articles help in Testing and
we must share the real time experience also
so i preparing that one as soon as i share to everyone
thanks
good luck to everyone
Be prepare for coming time in IT
Great!!! Simple, precise & accurate way of making others to understand the concepts… Thanks
Good writing Vijay !!!
But, I have a doubt here. When you apply the equivalence class partitioning for the input in the above example you have had 3 partitions - within the limit, above upper limit and below lower limit. Now my question is - is this equivalence class partitioning limited to this, if thats the case then i dont see there is much difference in EP and BVA. If you apply BVA, EP is autometically applied.
Hope I am not very incorrect in my understanding, your views on this please.
Regards, Suhas M
@Kishore,
Do we apply the BVA for all the classes i.e valid class as well as invalid class? Or is it enough to apply the BVA for valid class only. It would be great if you could explain this with an example.
Regards, Suhas M.
Hello,
What a beautiful explanation.
Cld anybody pls help me in answering the following question - how many test cases will be generated for three check boxes and one button
Suhas
Nice thought!!
As per my knowledge we can use BVA for both the classes.
For eg: If I consider 5-50 a range then my
valid class: 5-50
invalid class: lets say =49.99 also we use the same technique.
Suhas
Nice thought!!
As per my knowledge we can use BVA for both the classes.
For eg: If I consider 5-50 a range then my
valid class: 5-50
invalid class: lets say (less than =4.99) and
other invalid class would be (greater than=49.99 )
Instead of writing test cases on all the values we can use BVA to minimise the no of test cases.
thanks
its very nice
Said nicely and simple. I’d like to add one more check (I was asked that in the interview) - would probably be a good idea to check the values somewhere in the middle. Let’s say if we’re testing values 1 to 100,000 we should also look into 1,000; 10,000, ect.
@Kishore
I am not clear yet,
For a valid range of input - if you apply BVA, its simililar to EP. So why do we need to apply EP and then BVA, because if you directly apply BVA to the above example it goes well.
I would like to explain what I have understood by BVA and EP by slightly modifying the above example.
Lets say a system accepts the input as number that ranges form 100-100000 or alphabetical/alphanumeric input with 3-6 char.
Now my classes will be
1.Only numbers.
2.Only alphabets.
3.Alphanumeric.
4.Numbers with special characters.
5.Alphabets with special characters.
6.Alphanumeric with special characters.
Out of this if you apply BVA for 1,2 and 3 its good enough.
Let me know if my understanding is correct. If you think I am wrong helpme understanding with explaining your views with my example.
Regards, Suhas M.
Suhas
Consider below example
Suppose my valid class is 10-100
If I am asked to write test cases, I would apply BVA to this class to minimize my number of test cases. Otherwise it would go from 10 to 100
Using BVA my test cases have reduced to SIX. Three for min value and three for max value.
9,10,11 and 99,100,101
Regards
kishore
@Kishor,
I completly agree with what you say about BVA, now for the input set 10-100 how would you apply EP ?
PS: My question is more to do with EP in the above example given by Vijay.
Hey Vijay, could you throw some light on this as well? Some how am getting a feel that the EP what you have explained is either incomplete or you have not have not explained it with a very good example.
Regards, Suhas M
Excellent brainstorming session Suhas
Well put it simple
Use ECP to divide input domain into equivalent class as you pointed out in your example and then use BVA to decide test cases on extreme edges.
very nice article about BVA and EP
regards,
Sharan
Hi Vijay
Candid to the comments does it really works. Since if you take a text box of 1 -1000 characters, then will it possible to execute without entering 1000 characters at an instant to verify whether it allow or not. If system allows then what’s the necessity to go for in between values (Equivalence Partitioning) since it allows all the 1000.
Is am byte confused here……? Can you please clear my doubt?
Also does really a Test Engineer use this strategy to prepare test cases for Black Box Testing?
Thanx
TQ
Hi, Vijay this is a great site. Good job. Can u mail me the software testing by ron patton ebook to rockys283@yahoo.co.in
Thanks and Regards
hai
can any body tell me the QTP life cycle all phases to me
more examples on manual test cases
give me some requirements to write test cases
sujani_2008@yahoo.com
Could anybody pls help me in answering the following question - how many test cases will be generated for three check boxes and one button which was questioned me in an interview.
Srinivasa Rao,
for 3 check boxes and one button - 8 test cases can be written. BTW, button was only to confuse but all 8 test cases are the possible selection of 3 check boxes.
Hope this helps. But I don’t understand why you were asking that question here in the comment section of BVA article.
@Suhas, Qastation
You can say that boundary value analysis test cases are the subset of Equivalence partitioning. As always you can select EP test cases similar to boundary value test cases. But BVA help to identify the upper and lower limit which may or may not be the part of EP tests.
As I said, rather than just picking some random values as your EP test cases won’t do. Carerful partitioning and analysis of equivalence classes to pick the best test cases that will exercise maximum test coverage is what expected from equivalence partitiong.
The example given is just to understand both concepts with a single example.
Sorry, Sreedhar for posting the question in the comment section of BVA. Thanks for the answer.
It is believed that EP is a good technique to reduce the number of test cases to a bare minimum. Though EP is related to efficiency of test case design, I think that we should be aware that using EP could prevent the discovery of defects related to particular data value(s) in a range. Consider a date input text box (with a calendar control) that accepts dates between 1 Jan 1970 and today. We have three classes (also called partitions) here
1) = 7 Nov 2008.
By just selecting one test data value from each class might not be able to exercise the application with other interesting values e.g. 29 Feb 2008 or any particular value not handled correctly by the application.
Part of my comment has gone missing when posted. Therefore, I am posting my comment again:
It is believed that EP is a good technique to reduce the number of test cases to a bare minimum. Though EP is related to efficiency of test case design, I think that we should be aware that using EP could prevent the discovery of defects related to particular data value(s) in a range. Consider a date input text box (with a calendar control) that accepts dates between 1 Jan 1970 and today. We have three classes (also called partitions) here:
Less than or equal to 31 Dec 1969, 1 Jan 1970 to 6 Nov 2008, greater than or equal to 7 Nov 2008.
By just selecting one test data value from each class might not be able to exercise the application with other interesting values e.g. 29 Feb 2008 or any particular value not handled correctly by the application.
Inder P Singh
Hi Vijay
I din’t know where to put this question because there is no category for that.
Can you help me with ways of testing an artificial intelligence software/product
thanks Tanvi
Good topic. It is very user full…..why cont you explain about estimation concept in testing
Thanks
HP
this is a great article.
can anybody mail me the software testing ebook.
my mail id: oasisuser4@gmail.com
Respected seniors, Vijay plz. answer me.
How to answer - “what METRICS do you use? How many types of metrics are there?” It’s a most imp question in interviews. As far as i know, different metrics are–Defect Density, Defect Leakage, Traceability Matrix, Bug Trend Analysis(means comparing no of bugs in different versions). Types of Metrics are Process, Product, Project. “Do CMM, ISO 9000 come under Metrics?”. I am not concluding the above information. My attempt is to make clear that on what topic seniors have to give their kind and valuable suggestions.
Plz. respond with full details.
Yours faithfully………Sirisha
hello sir/madam,
actually, how many types of “Test Reports” are there?
i came through different terminology like—
Test summary reports
Test execution reports
Test status reports
Test log reports
Test daily, weekly reports
These all mean same??? if not please explain me and also explain me if there are any other reports that come under above list. in the least case please provide me exact link. Thanks in advance.
@Sirisha
Types of Metrics:
Process & Product/Project (depends upon application)
Under process metrics: Evaluates the efficiency of the process you use for your production (Project)
Effort, Schedule, Quality (DRE)
Product/Project:
Can have DRE also here, Phasewise defect removal, defect density and etc.
….mm Tracability Matrix is used for trace the requirements. It’s an verification techniques, not metric.
@Swapna
All the above mentioned reports are of same.
It depends upon the organisation requirements they will name it as they are.
Hi,
very useful article written in simple way so that any one can understand it easily.
Thanks…..
But I think very less topics are covered….Plz write more topics on testing….It will be very helpfull to us…..
GUYS and GALS,
from what i see in the article BVA and EP just different method of testing. Use either one.
Now can anyone help me in this scenario
i have 2 textboxes or fields, and
One can be entered with only alphabet
another can be entered with only number
so how can i use BVA on this scenario
won’t there be too many scenario?
such
- leading space i.e. ” hello”
- blank
- symbol
Can someone post all the scenario?
Greatly appreciated..
@LAKSHMI
Hi Lakshmi,
If u do the certification in Testing that will give good weightage to ur Resume.
Suppose if any organization is following RUP model those organizations will give more importance to Certified Test Engineers.
If u r intrested to do certification in S/w Testing u can mail me at srikanthvelivela@gmail.com for further details.
In BVA, we are taking the values from the edges of the classes and write the test cases. But in EP, We are taking the value from each classes and write the test cases.
Dear BAO,
U can try out by permutation for both fields.
Am I right all there?
hi,
In order to test for a text box that excepts amount in the range 1 to 100 we need to test for the following condition:
1. First see if the text box accepts alphabets
2. second whether it accepts special characters
3. Then enter “2e4″ in some cases it allows this and converts to exponent which should not be allowed
4. then go for BVA
i.e enter 0,1,2 and 99,100,101
Dont u think this is the approach that needs to be followed.
dear lakshmi,
your approach is correct,use some more combinations like alphanumeric+specialcharacters and
alphabets+small letters+numericals+special characters.
hey sorry,rashmi.
can you tell me Installation Testing….!
hi raj,
Installation testing should be done in the collabartion with the configuration engineer.
installation is the process which first time client/user is going to interacted with our product/appl.
installation testing is done to ensure that the client/user do not feel trouble while installing the software.
thank you
hi,
what is statement coverage and branch coverage? could you explain with examples.
thanks
Guys,
Please answer for it:
In a system designed to work out the tax to be paid: An employee has £4000 of salary tax free. The next £1500 is taxed at 10% The next £28000 is taxed at 22% Any further amount is taxed at 40% To the nearest whole pound, which of these is a valid Boundary Value Analysis test case? a) £1500 b) £32001 c) £33501 d) £28000
Option C is correct. Valid values for the above scenario will be -1,0,1,3999,4000, 4001, 5499,5500, 5501, 33499,33500,33501.
Exactly u r correct Sreedhar…Thanks for reply
1500+28000+4000 = 33500 +1 is 33501(last boundry)
Leave a Comment