[Thuban-list] tests for Daniel Cavelo's classifiers

Bernhard Reiter bernhard at intevation.de
Thu Jan 20 21:48:36 CET 2005


Hi Moritz,

On Tue, Jan 18, 2005 at 10:19:24AM +0100, Moritz Lennert wrote:
> [First one didn't come through since I forgot to gzip the patch.]

It did later, only the moderator had to approve it.

> Finally have come back to this:

First thanks for getting the ball rolling again
on that huge patch. 


> On Wed, October 20, 2004 6:53, Jan-Oliver Wagner said:
> > On Wed, Oct 20, 2004 at 12:14:43AM +0200, Moritz Lennert wrote:
> >> Daniel told me that the lack of test keeps his patches for the classifier
> from being integrated into the CVS. Could someone explain to me what
> exactly is needed in terms of tests and how I could contribute ?

We hope to have unit tests that shall test a lot of the code path
automaticall when being run in 
	cd tests
	python runtests

So we hope that contributors write a few of those tests 
because you can only do this with detailed knowledge of the code.
Ones you get into writing tests, it really is fun, because you can
write them before implementing something and then see them succeed.

> > So first step would be to apply the patch for HEAD.
> 
> Attached is a version of the patches that applies cleanly to current (20050118
> at ca. 1am) CVS HEAD, plus the necessary additional files that can just be
> dropped in. This version of the patch also includes two bug fixes, one to the
> discont algorithm and one general one, dealing with no data situations.

I take it the fixes are for the new code itself, 
otherwise you could extract them into smaller patches.
BTW: the -N switch to diff should even give you diffs of the new files, 
which might be easier to packages.

> > Next, one should think about what are the most important tests
> > and add them to the directory test/
> > There you can see how the other tests are made - not too difficult in
> > practice but some brain work to have them useful.
> > test_color.py is a simple one to get the idea.
> 
> I haven't had time to look into this in great detail (and won't have in the
> near future), so if someone else has the opportunity to do so, that would be
> great. (I guess I'll also have to read
> http://diveintopython.org/unit_testing/index.html in order to completely
> understand the testing business.)

No, it is quite easy: Just copy an appropriate test and start adding
one function for each method that is new in the patch.

> I would really appreciate if this patch could be integrated into cvs as that
> would make it possible to install with debian apt-get and have everything
> integrated...

What we also would like to have would be a Changelog entry.
It makes it easer to understand what is going on from an overview
point of view.

I also noticed that the new files do not have a header.
Daniel: Would it be okay for you to assign the copyrights to us?
Our idea is to keep them all in one place.


Happy hacking,
Bernhard R.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://www.intevation.de/pipermail/thuban-devel/attachments/20050120/c92fdd1b/attachment.bin


More information about the Thuban-devel mailing list

This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)