Re: Testing Java classes



Hi Lionel,

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?

the usual tests are:

1. test the boundary legal values (0 and 400). The expected behaviour
ist that these values are accepted.

2. test the both first values outside the boundary (-1 and 401). The
expexted behaviour is that these values are not accepted.

3. test a value somewhere inside the legal boundaries, usually in the
middle of the legal range (eg. 199). The expected behaviour ist that
these values are accepted.

It is necessary to test values outside the boundaries to verify the
correct boundary checking. And it is useful to test a value from
inside the boundaries to ensure that not only the boundary values are
accepted.

cu
Dirk
.



Relevant Pages

  • Re: Testing Java classes
    ... We check the boundaries obviously, but is it necessary to test the class by attempting to set userVariable to say -1 or 401? ... The expected behaviour ... It is necessary to test values outside the boundaries to verify the ... Should it throw an exception, the conclusion that I came to last time was that it wasn't necessary to throw an exception. ...
    (comp.lang.java.programmer)
  • Re: 2 Domains 1 SMS-Site to 2 Domains 2 SMS-Sites
    ... Check smslogon\sites on all of your DCs and verify that both site codes ... appear in both sites (ie overlapping boundaries) or just one? ... This posting is provided "AS IS" with no warranties, and confers no rights. ...
    (microsoft.public.sms.admin)
  • Re: Advanced Client Installation
    ... Could you both verify in the all systems collection what the Assigned ... Assuming they are within boundaries doesn't really help, ... subnet & Active directory site values. ... You have added the AD site to the SMS site boundaries? ...
    (microsoft.public.sms.admin)
  • Re: strange behavior installing legacy clients
    ... Could you open the file netconf.ncf on the cap, and verify whether the ... boundaries are in there? ... > but the clients are unninstalled after some time ... Kim Oppalfens ...
    (microsoft.public.sms.setup)
  • Re: speedup dont destroy background
    ... All of my time-critical code is at known boundaries, and I use the Merlin ERR psueudo-op to verify that they continue to fit within their allotted space as they evolve. ...
    (comp.sys.apple2.programmer)