On Mon, 2002-11-04 at 20:43, Vincent Massol wrote:
>
> There are already default results for lots of types. I think the default
> values should the ones defined by the JVM specification (which is null
> for Objects).
The idea behind the default return types is to avoid brittle or
overspecified tests. If you want to test one particular interaction
between two objects, you don't want to setup or expect irrelevant method
calls so that the test doesn't break as you change other parts of the
tested class. But conversely, you don't want your test to fail with an
error because the class receives an invalid value from a called method.
So the default return types are used to return safe but "empty" values
from methods that have not been given explicit result values.
Cheers,
Nat.
--
Dr. Nathaniel Pryce, Technical Director, B13media Ltd.
Studio 3a, 22-24 Highbury Grove, London N5 2EA, UK
http://www.b13media.com
|