MoonTest

delphimoon

MoonTest

Top  Previous  Next

 

The DUnit framework (see http://sourceforge.net/projects/dunit/ for the necessary sources and the documentation) allows to add testing close to the code to be tested, one of the parts of the programming technique called Extreme Programming (XP). But even in classical programming such automatic tests can be very useful to make sure that changes in the code don't change the results.

 

The project testmoon.dpr applies many of the examples from Meeus to the actual implementations of the functions, and warns when the results are off by more than the deviation caused by the algorithm itself. Of course all the tests work for the released version of the algorithms - but in case you want to modify them these tests can be a good reality check, or to add new tests not yet covered by those in moontest.pas.

 

Notice that DUnit only works with Delphi 4 and higher as it uses overloading internally a lot.