About Unit tests

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

About Unit tests

Andrey Larionov
 
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?
Reply | Threaded
Open this post in threaded view
|

Re: About Unit tests

David T. Lewis
 
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

Reply | Threaded
Open this post in threaded view
|

Re: About Unit tests

Andrey Larionov
 
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...

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?


On Sat, Sep 5, 2009 at 20:33, David T. Lewis<[hidden email]> 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.
>
> Dave
>
>
Reply | Threaded
Open this post in threaded view
|

Re: About Unit tests

Andrey Larionov
 
Also as i understand, BitBlt realised only for Linux. Is it true? In
Windows used GDI BitBlt?

On Sat, Sep 5, 2009 at 20:43, Andrey Larionov<[hidden email]> wrote:

> 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...
>
> 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?
>
>
> On Sat, Sep 5, 2009 at 20:33, David T. Lewis<[hidden email]> 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.
>>
>> Dave
>>
>>
>
Reply | Threaded
Open this post in threaded view
|

Re: About Unit tests

Andrey Larionov
 
Not Linux - Unix.

On Sat, Sep 5, 2009 at 21:13, Andrey Larionov<[hidden email]> wrote:

> Also as i understand, BitBlt realised only for Linux. Is it true? In
> Windows used GDI BitBlt?
>
> On Sat, Sep 5, 2009 at 20:43, Andrey Larionov<[hidden email]> wrote:
>> 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...
>>
>> 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?
>>
>>
>> On Sat, Sep 5, 2009 at 20:33, David T. Lewis<[hidden email]> 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.
>>>
>>> Dave
>>>
>>>
>>
>
Reply | Threaded
Open this post in threaded view
|

Re: About Unit tests

David T. Lewis
In reply to this post by Andrey Larionov
 
On Sat, Sep 05, 2009 at 08:43:49PM +0400, Andrey Larionov wrote:

>
> On Sat, Sep 5, 2009 at 20:33, David T. Lewis<[hidden email]> 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

Reply | Threaded
Open this post in threaded view
|

Re: About Unit tests

Andrey Larionov
 
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<[hidden email]> 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<[hidden email]> 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
>
>

BitBltSimulationAndTests.2.cs (3K) Download Attachment