Open nicktohzyu opened 3 years ago
We are completely blind to the implementation so we can't really assume it doesn't check for the range. I would think that the mentioned range just helps us narrow down the equivalence partitions (MIN..9, 10..100, 101..MAX). So regardless, we should still test these values.
My thinking is that since they explicitly talk about 10..100, all the more I would want to test the out-of-bound values just to see if it works as specified.
Also, it's kinda strange that the e.g. uses n = 5 which is already outside the specified range
We are completely blind to the implementation so we can't really assume it doesn't check for the range. I would think that the mentioned range just helps us narrow down the equivalence partitions (MIN..9, 10..100, 101..MAX). So regardless, we should still test these values.
My thinking is that since they explicitly talk about 10..100, all the more I would want to test the out-of-bound values just to see if it works as specified.
Yes, values outside of this range are to be considered invalid inputs and should be tested in negative test cases. Indeed, the question doesn't specify the expected behavior for those invalid inputs. Probably left out to reduce the amount of reading required during the exam.
Also, it's kinda strange that the e.g. uses n = 5 which is already outside the specified range
Yes, IIRC, that was a mistake in the question. The valid range was changed for some reason but forgot to change the example.
From this paper, the method has parameter
int n
, and the javadocs says that it is only defined for range 10-100. The method does not seem to throw any checked exceptions either. Hence, when designing tests for this method, should values outside of the range be considered?