Neat test-driven coding trick

danielv at netvision.net.il danielv at netvision.net.il
Sun Jul 21 20:53:10 UTC 2002


Probably I'm not the only one that dislikes the tendency of the test
runner to take two hours to tell me everythings fine.

Enter the power of InfoStringMorphs. Put this in the comment for the
test you're working on. Doit. 
(InfoStringMorph on: [self name, ' ', self suite run printString])
openInWorld

Drag the InfoStringMorph somewhere where you'll see it. A good contrast
between text and background is important, or you won't notice when it
changes.

After this, you'll know roughly 1000ms after breaking (or passing) your
tests. Who needs a gui when you have morphs and a useful, smart model?

Related cute tricks - 
* try putting a self halt in a tricky methods exercised by the test.
* Of course you can compose suites more interesting than just one test.
* Be careful of slow tests!! they're a menace to your CPU! hint - you
can change the step time for a specific InfoStringMorph...

Daniel Vainsencher



More information about the Squeak-dev mailing list