let us see this following example :
Input should be greater than equal to 5 and less than 10
Probably you will write something like
if (input >=5 AND input <10)>
then
do this
else
do some thing else.
So, according to this input values from 5 to 9 are valid, but if you make mistake in specifying the conditions, following things can happen
input >5 AND input <10-------> Input value 10 in invalid now
input <=5 AND input <10> Input value 4 is valid now
input >=5 AND input <=10 -----> Input value 10 is valid now
input >=5 AND input >10 -----> Input value 9 is invalid now
Because it is very easy to introduce defects at boundaries, boundary values are important. So for the above example, at the minimum we should have following test cases for boundaries
4,5,6 and 8, 9, 10
lower_boundary - 1, lower_boundary, lower_boundary + 1 and upper_boundary - 1, upper_boundary, upper_boundary + 1.
what is off-by-one
off-by-one: An exceedingly common error induced in many ways, such as by starting at zero when you should have started at one or vice-versa.
Related Topics:


No comments:
Post a Comment