[Gambas-user] Merge request for gb.test

Christof Thalhofer chrisml at deganius.de
Tue Sep 10 20:07:24 CEST 2019


Hello,

because I was asked what the new component and tests at all are
necessary for, I want to explain it a little bit:

Tests are mostly necessary when projects become larger and the
dependencies grow. I started testing when I wrote a library that takes
on many tasks that are identical in several programs of our firm:

Database access, rights management, locking resources during editing,
writing logs, error handling, providing help texts, help functions in
forms, sending mail, encrypting and decrypting data, templating, setting
flags in bitarrays, caching data and so on and so forth.

We now have about twenty different programs written in Gambas that use
library functions, so they depend on the lib working.

In addition, functions in the library use other functions in the
library. For example, rights management uses functions such as caching
(so that the same information is not fetched over and over from the DB)
and bit arrays, which can store rights in a space-saving way and read
them out quickly.

If I now make a mistake with a deep lying method while programming or
fixing bugs, it can be that I damage several programs with it under
circumstances at places which become visible only after months as
problem, if the programs rarely use the damaged function.

So that's what tests are for. When I program, I can use tests to check
whether I have inadvertently destroyed crucial functions.

And I can even program "test-driven". I first write the test that tests
a function and after that write the function itself, and I can be quite
sure that I won't get tangled up as I continue programming:

https://en.wikipedia.org/wiki/Test-driven_development

Thank you, DeepL: Translated with www.DeepL.com/Translator
Now I learned the word "inadvertently". ;-)

Alles Gute

Christof Thalhofer

-- 
Dies ist keine Signatur

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.gambas-basic.org/pipermail/user/attachments/20190910/853ba6a0/attachment.sig>


More information about the User mailing list