[Vm-dev] About Unit tests

David T. Lewis lewis at mail.msen.com
Sat Sep 5 16:33:57 UTC 2009


On Sat, Sep 05, 2009 at 08:06:59PM +0400, Andrey Larionov wrote:
>  
> I found information about uncomplete NuBlt plugin. I have an idea try
> to complete work.
> Even plugins write in Slang it strange what there are no unit tests
> for them. Unit tests allows some users to contribute without fair to
> broke something
> 
> Is Slang code can be simple eveluated or it need simulation to run tests?

Some plugins have unit tests, and many do not. If NuBlt does not have
tests, it would definitely be a good idea to write some.

Slang code can be directly evaluated as Smalltalk, but this is not
always useful because you need to really deal with the code as it
is translated to C (SlangBrowser may help you here, see
http://wiki.squeak.org/squeak/5916).

When writing unit tests for a plugin, it is common to write tests that
call the primitive in the plugin, and test for the expected result.
Also, if your method that calls the primitive is going to use fallback
code so it works when the primitive fails, you can write tests to
verify that the primitive produces results identical to the Smalltalk
fallback code.

Dave



More information about the Vm-dev mailing list