L
Lionel
Some may remember that I've asked about error checking not long ago.
As a follow up I have a question regarding testing. Let the class
UserClass contain the variable int userVariable such that a user enters
the value of userVariable and it is checked to be valid before the class
is constructed or before a method such as a setter method is called on
UserClass that alters the value of userVariable.
So, if it is assumed that the variable userVariable will always fall
between say 0 and 400 inclusive, what should our tests be on this class?
We check the boundaries obviously, but is it necessary to test the class
by attempting to set userVariable to say -1 or 401? If so, what
behaviour would we expect?
Thanks
Lionel.
As a follow up I have a question regarding testing. Let the class
UserClass contain the variable int userVariable such that a user enters
the value of userVariable and it is checked to be valid before the class
is constructed or before a method such as a setter method is called on
UserClass that alters the value of userVariable.
So, if it is assumed that the variable userVariable will always fall
between say 0 and 400 inclusive, what should our tests be on this class?
We check the boundaries obviously, but is it necessary to test the class
by attempting to set userVariable to say -1 or 401? If so, what
behaviour would we expect?
Thanks
Lionel.