[coyotos-dev] Test infrastructure for bignum

Thomas Stratmann thomas.stratmann at rub.de
Fri Mar 7 15:45:23 EST 2008


I was about to move code around in bignum to make it more maintainable, 
but I realized that it would not be a good idea to do so without testing 
for expected behaviour prior and after the changes.

Writing tests for bignum is also a good thing in itself for several 
reasons. One ist that, at least for now, it replaces API documentation.

I would like to know if there is already any support for testing 
purposes, any kind of infrastructure, inside the build system. Any 
code-place I can look at? Currently, I have an ugly hack that "borrows" 
some configure and makefile stuff from parent folders -- I'd prefer 
things to flow in the other direction: something like "make test" that 
traverses the whole system.

What tools can I use to trigger/prepare the tests? Is bash ok? Some kind 
of scripting will be necessary to feed the test programs with numeric 
input, in order to avoid modifying source code or compiling with -DTEST17.

Another thing to consider is directory structure: a good testing habit 
is to differentiate between tests triggering old bugs ("regression"), 
tests meant to replace api documentation and tests for the aid of the 
maintainer to keep things working the way he/she assumes to do. In order 
not to clutter things, either some extra directory ${project}_tests 
(like bignum_tests) should be used with test classes inside, or the 
project (bignum) could go into a subdir together with its tests.
I can prepare for either, just let me know what the project prefers.

Thomas


More information about the coyotos-dev mailing list