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.




95 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)
hi…very nice article with good explanation with simple examples in simple language, so that every one can understand it easily.
it very nice article to get the knowledge of boundary value analysis and equal partitioning….great work
its very good n useful…
thanks very much..
It’s a very nice article. Thanks for sharing knowledge.
Hi,
I have 4 yrs of experience in manual testing. Which certification will help me to shape up my career graph.
regards
Bithika
thanks for ur valuable reply…
Hi
It’s good sharing your knowledge with others about equivalence and boundary value analysis, but I am having one doubt, you have taken the example for only single instance what will happen if there are multiple instances? Its take time and somewhat difficult to do that. Recently I have seen a tool called “TestersDesk.com” Which is useful for both TestDesign and TestData Generation Toolkit in that Boundary value analysis tool is there with the help of tool we can reduce our work and can do for multiple instances at the same time
hi bithika,
you can go for ISTQB(foundation level) first.After
that you can go for Advanced level.Tthen u can be called as ISTQB certified functional tester/technical tester.
Thank u
cheers,
CH.GIRISH CHANDER RAJU
CERTIFIED TEST ENGINEER
Hi
Can anyone explain me the process of Business Testing
Thanks man
its really good.I can suggest to give some more examples so that people can understand in a better way!
Nice concise explanations and examples of EP and BV - makes my revision a lot easier! Cheers!
Its very nice article which is explained in simple words so that every one can understand. Nice work Ajay!! Thanks for sharing this gr8 article..Keep it up!!
Great work VIJAY!!
I really appreciate ur work and all those who have posted their comments
Its very nice article
Hi All,
Could anyone please give me a justifying answer for wat suhas has askd on the efficiency of Equivalence partitioning over BVA? Because as he said, BVA is going to cover all of the scenarios including what we are trying to cover in EP. Please let me know with a clear example.
BVA is something it covers the valid and invalid class of EP.
For ex: 60 - 120
for equivalance partitioning we go by the value
59 60 61 119 120 121
59.9 60 60.1 70 119.9 120 120.1
In case of value 59 is a invalid class, similarly 121 is an invalid class.
Could anyone clear me if i am wrong?
I think this misses the heart of equivalence class partitioning. A number range does not offer a good opportunity to describe equivalence classes because 1-1000 everything is equivalent. One can only understand the technique when some are not equivalent.
Let’s say one is testing an eCommerce application and there’s a drop-down for selecting the state. Some states have no tax, others have tax, and some the company cannot ship to. Equicalence class partitioning might lead you to choose at least one state each from:
0 tax + can ship
0 tax + cannot ship
>0tax + can ship
>0tax + cannot ship
0 tax and >0 tax are different because they have different semantics to the app. 5% tax and 6% tax yield different results but you expect the behavior to be similar (tax amt. should be tax % * taxable total) and testing every possible combo 5%, 5.5%, 6%, etc. might not be practical.
As always, go back to the classics. Glenford Myers “the art of software testing” is a good resource.
hi every1,
thnaks to all because of you guys I come to know the new terms which i never heard.. thank you very much
especially to susma
[…] class are known as Boundary values. Analyzing the behavior of a system using such values is called Boundary value analysis […]
this is a nice explaination with a neat example.
thanks for giving an important info about boundary value analysis.
Nice example
very good…..
thanks!
How can we made equivalence partioning for a field where date is the input like 1 Jan 1976 to 5 Nvoember 2009?
What would be the Equivalence classes…consder the leap years also
Good article and comments with nice examples. Thanx.
Thnx…its a nice example
Can anyone explain me the process of Avinoncs software Testing
Good stuff!!!!!! Please keep doing
Check the link. You can have a detailed idea about how and why this practice has been adopted!
BVA Formula :
n-1, n, n+1
Ex: 1 - 1000 find BVA for this
0,1,2, 999,1000,1001 (is valid BVA for)
hi friend
Sombody asked about Tracebility Matrix in this question answer thread.
Anser to Tracebility matrix : Tacebility matrix a document which track the completeness. e.g. Requirement Tracebility Matrics(RTM). In RTM we note down all the requirements id which are there in SRS. As and when we start writing test cases againist requirements, we keep updating those test cases id in RTM against respective requirements.
Hope this short description will help you to understand about Tracebility matrics. gook luck , happy testing.
Leave a Comment