[Vm-dev] About Unit tests

David T. Lewis lewis at mail.msen.com
Sat Sep 5 17:54:49 UTC 2009


On Sat, Sep 05, 2009 at 08:43:49PM +0400, Andrey Larionov wrote:
> 
> On Sat, Sep 5, 2009 at 20:33, David T. Lewis<lewis at mail.msen.com> wrote:
> >
> > 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.
>  
> As i understand, NuBlt shoud produce analogous results as BitBlt, so
> it will be realy simple to test new plugin for conformance with
> another. But...

I do not know if any unit tests exist for BitBlt, maybe someone else on
the list can answer.

> Maybe we should test produced C code? Write tests in Slang and then if
> any tests generated, run it before final assembly procedure during
> make?

For something like BitBlt, I would think that it is best to test from
the image itself (each test would set up input data, call the primitive,
and verify output data). Tests should not care about the C code generated,
just the results.  Again, I do not know if any such tests exist.

Dave



More information about the Vm-dev mailing list