Class comments!?

Tim Rowledge tim at sumeru.stanford.edu
Mon Oct 18 22:20:53 UTC 2004


Bernhard Pieber <bernhard at pieber.com> wrote:


> economic argument: Given a finite amount of time, what is it best spent
> on to increase the understanding for the reader: Writing additional
> tests, refactor the code or write comments?
IF one can write sufficiently full tests I suspect that they could form
a useful portion of the documentation that I would want to see. The
problem I see with this (and to be honest, with any attempt to provide
doc, explanations etc) is getting good coverage. Tests really ought to
check that the correct thing is done with logical inputs _and_
completely wrong ones. Too often we just check that, oh yeah, the window
opens when I do #foo. So what about doing #foo before the size has been
set, what about the response to ludicrous sizes or positions, what
happens when you try to update a bigger area than the window
encompasses (err, can you see what I've been testing recently?) and on
and on.

Obviously, the test code needs commentary of some sort to explain what
is being tested, why, any areas that are of concern but not yet covered
- and we're back to arguing about commenting code :-)


tim
--
Tim Rowledge, tim at sumeru.stanford.edu, http://sumeru.stanford.edu/tim
Long computations that yield zero are probably all for naught.



More information about the Squeak-dev mailing list