[fpc-pascal] FPCUnit article/tutorial online.

L505 fpc505 at z505.com
Tue Oct 11 00:33:44 CEST 2005


> debugger (I still don't know how to use it effectively with Free Pascal
> and in Lazarus I usually keep it disabled :) A failing test usually

Same here, I may be speaking from small project experience though, rather than huge/large
level project experience. I think I may use the debugger more often on large projects in the
future.

> But in my case, when I'm doing unit testing of non visual code in more
> complex frameworks and I find a class that is difficult to test in

Right, after reading some more about unit tests, I figure testing will be useful more for
stdout/piping/cgi/compiler/HaveToBeCorrect style applications moreso than in GUI style apps.
And I do build those type of apps.

> in my design, often the classes proved to be too tightly coupled or had
> a wrong interface. So, from my experience, writing tests has the side
> effect to improve the design of my code.

I've written about stuff  like this before too, such as "Problems with designing software
around forms" which many delphi programmers do. So the ideas behind unit tests would agree
with some of my thinking. I think many people tightly couple their applications around Form1
too much, mainly in larger applications. In smaller applications, making a form1 style
application is quick, convenient, and more beneficial than going from scratch with your own
thought out design.

> The Free Pascal Compiler is the best example of the success of testing,

A compiler of course needs to be tested...  :)  which i think is bit biased bringing it up..
but I see the purpose of tests more now that you mention the compiler. So biased examples
are okay, to bring about a point. I bring up biases all the time.

Compilers need to be tested vigorously for correctness - moreso than any other peice of
software.. since it creates the software, and that software better well be correct when fed
source code that is correct!




More information about the fpc-pascal mailing list