In one of the Software Testing training sessions in Payilagam, a trainee raised a nice question.  Why do we need Boundary Value Analysis as a technique in Black Box Testing?

### Equivalence Class Partitioning

We have a testing technique called “Equivalence Class Partitioning”.  This technique itself is enough to test all kinds of test data.  ECP splits the test data into three categories – Valid Data, Invalid Data below the valid range and Invalid Data above the valid range.  For example, if test data for age should be between 18 and 60 – The Valid range here is 18 -60.  Two invalid ranges are a random value below 18 and a random number above 60.  Hence, with three partitions – we can test the data.

Is this technique enough for verifying valid and invalid test data?  If we consider this is enough, then what is the need for Boundary Value Analysis?  Why do we need BVA?  This is the question raised in our training session.

### Why do we need Boundary Value Analysis?

Boundary Value Analysis (in short, BVA) also uses Equivalence Class Partitioning as basis.  What we call as Equivalence Classes in ECP will be treated as Neighbors in Boundary Value Analysis (BVA).  When we neighbors, it is very apparent that we should have boundaries between them.  And of course, when there are boundaries, there could be conflict of interests.  Whatever we see in real world, everything should be present in technical world as well, right!

### Boundaries in Cricket:

We know what Boundary line in the game of cricket is.  If the batsman hits the ball out of the boundary line, six runs will be granted.  If the ball hits the ground before reaching the boundary line, four runs will be granted.  Every cricket fan knows this.  If the ball hits very near to the boundary line, then the umpire will go for replay option to decide if it is 4 or 6.  We need to go for replay when the ball is hitting very near to the boundary line, because it could cause confusion.

### Same in Software:

The same confusion may persist in Software Development as well.  If the customer says – Till 135 CM height, children will be given half ticket – Developer may get confused here.  For 135 CM height, should we collect amount for half ticket or full ticket.  This confusion will get reflected in the final outcome in the actual software also.   Though ECP covers valid and invalid data, the boundaries should be given higher importance as this leads to erroneous software.  This is why – we have Boundary Value Analysis as another technique, which specifically focuses on boundaries below and above the test data.

`Photo Courtesy: http://www.cricket.com.au/`