[Gambas-user] Crash with latest version

Christof Thalhofer chrisml at deganius.de
Tue Mar 9 09:40:46 CET 2021


Am 08.03.21 um 22:49 schrieb Jussi Lahtinen:

>     But it would help a lot if you could write the expected behavior in
>     tests before you create a new method because if someone later would
>     alter the program we could assure that it won't destroy the expected
>     behavior.
> 
> I agree, and it would work kind of a part of documentation /
> standardization also.
> But it may also be too much work for Benoit.

My experience is that writing tests before the code often makes the work
easier and faster at all.

One part of the work as a programmer is to control whether the new code
does it's thingi right. Before gb.test I used to write small routines
that call new code so that I could run it with F5, stop at breakpoints,
control the content of variables, print sth to stdout and so on.

The predecessor of gb.test was created to keep control over that small
routines, which at the end not only started the different parts of the
code but also were able to test the output. So why not keep them for
later usage? Why not collect them in test suites? gb.test solved that
for me.

But the real benefit comes later.

I have written a database ORM for my firm which is quite complex and
consists of several layers (a SQL wrapper, which creates SQL queries, an
ORM that maps database tables to arrays of objects that represent
columns and calls the SQL wrapper on changes). Fortunately I have
written tests at every stage of the development that can verify that the
database contains the correct values after each run and each change. Now
I am quite sure I won't break the old behavior of this complex system
when I touch it and change or add things. It is much easier to touch the
system, it gives me much more freedom and i am free from fear.

Before gb.test I broke a lot of things in my software by accident when I
had to change old code, now it's a lot better.
So gb.test helps me at the other part of my work as a programmer when I
have to extend or fix old code.

It gives me much more reliability. I can't be 100% sure that I'll never
break old code again, but the amount of new bugs I produce has decreased
significantly for code which is covered by tests.

So the usage of gb.test not only made my software more reliable but it
also saved me a lot of time because I did not have to fix as much bugs
as before. Instead, I can use more of my energy to develop new things.

I am old and I have to use my energy sparingly. When I was young, I
could code for 16 hours a day for two months without a problem,
producing and fixing lots and lots of bugs. gb.test is a crutch for old
programmers, if you are young and have too much energy, don't use it.

;-)

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: <http://lists.gambas-basic.org/pipermail/user/attachments/20210309/81a275d9/attachment-0001.sig>


More information about the User mailing list