SUnits documentation Re: Is this list a chat or a list REALLY ?
Andrew C. Greenberg
werdna at mucow.com
Wed Aug 15 11:26:21 UTC 2001
On Wednesday, August 15, 2001, at 01:17 AM, Karl Ramberg wrote:
> I tried to test the SUnits a while back and did not understand
> anything. I'd love a good writeup on how to use SUnits and how to write
> test suite for your own code.
Basically, to start putting together a test suite for, say, class Foo,
1. subclass TestCase, say, TestFoo.
2. create methods in TestFoo, typically small bytesize tests, name
each method test***, for exampe: testInitWithBlank testInitWithArray
testBorderChecking, and so forth. Each method will make use of either
the assert:, should:, shouldn't: and some of the more sophisticated
methods -- read the code in TestCase for examples. Read the beck paper
and learn how to build scaffolds and the like to use these tools in a
subtler, more sophisticated fashion, but for now, set up some test
cases. Beck has a useful article at:
http://www.xprogramming.com/testfram.htm
3. open a GUI, TestModel openAsMorph will do. Click run (It will
run all tests in the system). If you want a more refined or narrow
group of tests, adjust the filter to, say:
TestFoo.test*
Those are the basics. Take a look at the example in the TestSuit itself.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/enriched
Size: 1279 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20010815/77dcf4a6/attachment.bin
More information about the Squeak-dev
mailing list
|