nus-cs2103-AY1819S2 / forum

CS2103/T discussion forum
6 stars 1 forks source link

Should test cases test for scenarios that are not accounted for? #97

Open bos10 opened 5 years ago

bos10 commented 5 years ago

With reference to this question in the mock paper :

image and the corresponding answer: image

Is testing for decimal values considered a valid test case here? The question did not specify if it will throw an invalidArgumentException. So I am not sure what to put under the 'expected outcome'.

ccristina commented 5 years ago

Hi,

The assumption here is that moduleCode is an integer. You may assume that another method will check that before calling getClassSize.

If you are not sure about such assumptions, come up with 7 testcases strictly following the method/problem description, and continue to come up with others after these first 7.

Let us know if you still have questions.

Best regards, Cristina.