users@codemodel.java.net

Re: New developer. Some thoughts on test suite.

From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Date: Wed, 22 Nov 2006 16:11:09 -0800

Aleksei Valikov wrote:
> I don't think we really need that smartness. I think code model must be
> just made deterministic.
>
> * Since code model is configured within the test, indentation is
> predictable/deterministic. Well, if the way classes are indented
> changes, test target sources must be updated, but I don't think it's
> that huge problem.
> * If order of imports is non-deterministic (HashMaps and so on), it
> should be made so.
>
> I'm really sure making code model deterministic makes a lot of sence.
> Tests and SVN diffs will profit from it. And it's not hard. Let's just
> watch our own tests and user reports. If an indeterministic behaviour is
> noticed/reported, we'll just fix it.

The point that I was trying to make is that say if we fix the
indentation algorithm a bit, for example to add or remove extra space
from somewhere.

Then we don't want to end up updating all the test cases, including
those test cases that are not designed to test that particular behavior.

IOW, if a test is too sensitive, that makes it harder to update the
code. Ideally, tests should only check what it's supposed to test, no
more, no less.

I agree that codemodel should be deterministic in its behavior, and I
think it is.

-- 
Kohsuke Kawaguchi
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com