SUnit Testing merged with Examples for Methods

Ward Cunningham ward at c2.com
Mon Dec 3 16:48:01 UTC 2001


Ted Kaehler wrote:

> (In the future, we'd like to have the kind of TestCases that SUnit
> has now, but not have the overhead of doubling the number of classes.
> One way to do this is to make Metaclass do everything that TestCase
> does.

Three (possibly contradictory) thoughts come to mind ...

We find that xp's test first method tends to produce about as much test code as code under test. Is it then unreasonable to expect the number of classes to double in proportion? Also, the author of a test sometimes finds need for instance variables and helper methods. Let's not loose these in an attempt to optimize.

That is not to say that some language/environment innovation couldn't change this statistic. I've had good luck with tables of values interpreted by fixture code that is much smaller than the typical SUnit equivalent.

Finally, if Tests are a parallel hierarchy, then perhaps we should take a cue from the Class-MetaClass parallel hierarchy. This would suggest that the buttons on the browser should read: [instance][class][test]

--
Ward Cunningham
v 503-245-5633   mailto:ward at c2.com
f 503-246-5587   http://c2.com/






More information about the Squeak-dev mailing list