Re: Testing Java classes
- From: Dirk Michaelsen <dirk.michaelsen@xxxxxxxxxxxxxx>
- Date: Thu, 28 Sep 2006 08:12:57 +0200
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
.
- References:
- Testing Java classes
- From: Lionel
- Testing Java classes
- Prev by Date: Re: Combobox how to disable edit but allow select
- Next by Date: Re: hashtable - select by wilecard... is it doable?
- Previous by thread: Testing Java classes
- Next by thread: Testing a Message Driven Application
- Index(es):
Relevant Pages
|
|