Going through Elisabeth Hendrickson's test heuristics cheatsheet , I see the following recommendations :
Numbers : 32768 (2^15) 32769 (2^15+ 1) 65536 (2^16) 65537 (2^16 +1) 2147483648 (2^31) 2147483649 (2^31+ 1) 4294967296 (2^32) 4294967297 (2^32+ 1)
Does someone know the reason for testing all theses cases ? My gut feeling goes with the data type the developer may have used ( integer, long, double...)
Similarly, with Strings :
Long (255, 256, 257, 1000, 1024, 2000, 2048 or more characters)
When numbers in a pattern get larger as the sequence continues, they are in an ascending pattern. Ascending patterns often involve multiplication or addition. When numbers in a pattern get smaller as the sequence continues, they are in a descending pattern. Descending patterns often involve division or subtraction.
Missing Number in a Sequence. Determine if the order of numbers is ascending (getting larger in value) or descending (becoming smaller in value). Find the difference between numbers that are next to each other. Use the difference between numbers to find the missing number.
Expert-Verified Answer The first sequence is 2, 4, 8, 16, ... Since the differences of the terms are not equal, then the sequence is not an arithmetic sequence. The second sequence is - 8, - 6, - 4, - 2, ... and third term - second term = - 4 - (- 6) = - 4 + 6 = 2.
2 (two) is a number, numeral and digit. It is the natural number following 1 and preceding 3. It is the smallest and only even prime number. Because it forms the basis of a duality, it has religious and spiritual significance in many cultures.
These represent boundaries
Integers
Testing for values close to common boundaries tests whether overflow is correctly handled (either arithmetic overflow in the case of various integer types, or buffer overflow in the case of long strings that might potentially overflow a buffer).
Strings
I suspect that the recommendations such as 255, 256, 1000, 1024, 2000, 2048 are based on experience/observation that some developers may allocate a fixed-size buffer that they feel is "big enough no matter what" and fail to check input. That attitude leads to buffer overflow attacks.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With