[Vm-dev] About Unit tests

Andrey Larionov anlarionov at gmail.com
Sat Sep 5 22:56:27 UTC 2009

Investigating BitBlt anatomy found incomplete tests (which should work
with simulation). After completing tests found fails in simulation. I
fixes this looking on available methods and tests passes. Could
anybody verify?
Work done in Pharo after filing in an Andreas simulator fix (discussed
in Pharo-dev)

Changeset in attachment.

On Sat, Sep 5, 2009 at 21:54, David T. Lewis<lewis at mail.msen.com> wrote:
> 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: BitBltSimulationAndTests.2.cs
Type: text/x-csharp
Size: 2742 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20090906/337ed654/BitBltSimulationAndTests.2-0001.bin

More information about the Vm-dev mailing list