About test presence

Frank Shearar frank.shearar at rnid.org.uk
Fri Dec 19 09:35:25 UTC 2003


Colin said:

> I'm afraid I must vehemently disagree with this position. I
> think it's
> a bad idea to couple the tests tightly to the code being tested. The
> problem with BrowseUnit is that it insists on a conventional
> relationship between the two. A ratio of one test case to one
> production class is fine in theory, but in practice there are several
> problems:

<snip lots of good stuff about tight coupling between test code and
production code being bad>

> In short, there are many ways to structure a test suite, and
> different
> structures provide different advantages and disadvantages. By
> enforcing
> strict conventions for test cases, BrowseUnit, forces developers to
> couple test and production code too tightly, reducing the
> usefulness of
> the tests. I think it would be a real shame if this convention were
> adopted and enforced by the Squeak community.

I was thinking about this 1-1 mapping being painful this morning. However,
I don't think I use BrowseUnit in quite the usual way. I typically have
two Browsers open, one with the production code I'm working on and one
with the tests for that code. In the test code browser, I use the BrowseUnit
buttons to run the tests for the message or class I'm working on - I don't
use them to create the test classes or messages. While I usually end up
with one test class for one production class, I usually have scads of test
messages for any particular message (depending on the complexity of the
message - some of the transaction state changes in SIP (RFC 3261) can cause
a lot of things to be tested - far too many for just one test message).

> PS. I'm partial Kazuki Minamitani's TestBrowser, although it hasn't
> worked well in recent versions of Squeak. I'd love to see
> this kind of
> tool further developed.

Yes, TestBrowser also rocks. And since I started using it the other day,
well,
I'm finding that it's actually a bit handier to use than BrowseUnit because
I can run the tests for an entire category as easily as testing one class or
message.

However, I stick by my guns on the slint button BrowseUnit provides :)

Although, if TestBrowser had a slint button on it that ran slint in another
process like BrowseUnit...

frank





More information about the Squeak-dev mailing list