lundi 9 octobre 2017

Boundary Value Analysis, Why does use two values inside the boundary?

I can't understand why to use two values inside the boundary when using Boundary Value Analysis. For instance, the program has the requirement: 1) Values between 1 and 100 are true, otherwise false.

func calc(x):
  if (x >= 1 and x <= 100):
    return True
  else:
    return False

A lot of books (Pressman, for instance) say you have to use the inputs 0, 1, 2, 99, 100 and 101 to test such program.

So, my question is: Why does use the inputs '2' and '99'? I try to make a program with a fault that the test case set (0, 1, 2, 99, 100 and 101) expose a fail and the test case set (0, 1, 100, 101) does not expose it. I can't make such program.

Could you make such program? If not, it is a waste of resource create redundant test cases '2' and '99'.

Aucun commentaire:

Enregistrer un commentaire