[Gambas-user] New component gb.test

Christof Thalhofer chrisml at deganius.de
Mon May 21 20:39:38 CEST 2018


Am 21.05.2018 um 19:22 schrieb Adrien Prokopowicz:

> There's something I just noticed in your implementation: why is a "test" 
> (in TAP terminology) mapped to a single assertion, and not to a whole 
> test method ?

This was not my implementation.

Mine is (the latest was):
https://github.com/Deganius/gb.deg.unittest/tree/develop

There test methods are combined to a "test suite" and can be executed
independent from each other in random order.

The test methods are in Testclasses, which are identified by inheriting
from UnitTest and the names of the testmethods inside start with "Test".

> The problem with this approach is that all assertions share state, which 
> should not be the case with tests: ideally a test should have no 
> influence on subsequent tests, otherwise a test following a failure 
> could be either a false positive or a false negative, and you can't 
> really test things in isolation.

Yes, I tried to discuss that as I wrote about fixtures. What I find
interesting with TAP is the standardized output format.

But I also would prefer the execution of single testmethods independent
from each other.

> After reading the TAP/Perl spec a bit more thoroughly, it seems they 
> also use this approch, which I find really wierd. Admittedly i've never 
> ever encountred Perl, but of all the testing tools I've seen and used 
> (I've looked into C, Rust, Ruby, Java, C# and Javascript for my testing) 
> I've never seen this approach before.

I startet with the fork of ComUnit which was a fork of JUnit for VB6.

Maybe we could combine the two approaches, the one from Tobi which is
the actual gb.test (which is a complete rewrite in honour of TAP, my
code is completely gone) and parts of mine.

But it could be difficult as these two are completely different.


Alles Gute

Christof Thalhofer

-- 
Dies ist keine Signatur

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20180521/fa817149/attachment-0001.sig>


More information about the User mailing list