I have a software requirement like "User shall be give a warning if value entered is >100" The requirement does not speak anything about the higher value. So obviously it is an open boundary condition. So how shall we conduct testing with invalid condition? What is the higher value I can consider for testing?
3 Answers
There is difference between Boundary Testing and Equivalence partitioning. With Equivalence, 101 will suffice. For Boundary, you'll need to know (or best guess) the data type. For example, if it is an INT, you can test a value larger than an INT supports. Normally, in this case the number would 'wrap around' to the negative end.
-
But if we need to know the INT etc variable used, it becomes kind of structural testing right? Suppose I will change the requirement something like "The tax rate above 100000 shall be 30%. So in this scenario, obviously I will have to test for the highest possible value because all value above specified above is valid. Where is the boundary in such case? Otherwise what if the amount entered wraps around and tax is calculated at lower rates? So obviously developer may has to indicate what is the maximum limit and beyond that what happens!! Commented Jul 21, 2015 at 1:49
-
Yes, you need to know an INT is used or try the values Steve outlined in his answer. Usually I have access to source code or at least the database so I know the data types. Commented Jul 21, 2015 at 14:02
If requirements coverage is your testing goal then any number >100 will do, such as 101. If you wish to be more thorough, then a list of commonly mishandled values such as this one can be a useful starting point.
If the value is a floating point or double type then I would suggest the following list of test values:
- At & Over Limit: 100, 100.0000000000001 (number of zeros depending on the resolution of your float type at 100) & 101
- Under Limit: 99.999999999999 (number of nines depending on the resolution of your float type at 100), 99, 0.0 (always worth checking), -99, -100, -101
- Special numbers that the developer may have got wrong, e.g.: 256, 32769, 65536, MAXINT+1, MAXLONG+1
- Bad Floating Point Numbers: +INF, -INF, NAN, SNAN - the question arises what is the code supposed to do in these cases.