Issue #1664: Unit Test support for mapserver

Umberto Nicoletti umberto.nicoletti at GMAIL.COM
Tue Feb 14 12:25:12 EST 2006


On 2/14/06, Frank Warmerdam <warmerdam at pobox.com> wrote:
> Umberto Nicoletti wrote:
> > I have opened issue #1664 to track comments, feedback and of course
> > criticisms on the much needed (IMHO) addition of unit tests to
> > mapserver.
>
> Umberto,
>
> I trust you are aware there are already two varieties of test suite
> already in place for mapserver, right?  Sean's Python MapScript based
> units tests, and my higher level render tests in the msautotest suite.
>

'Course I am, as a matter of facts your tests are functional tests (a
rather different beast from unit tests), while Sean's are unit tests,
but for python Mapscript.

The unit tests I am introducing can go deeper and test the intimate of
mapserver's code. Also unit tests can test a very limited and well
defined subset of code, making memory leaks/memory
misbehaviours/threading issue easier to spot. For instance I have
written unit tests for the connection pooling which is not covered by
Sean's tests because connection pooling functions are not exposed by
mapscript and neither by yours.

IMHO it is not the case I have to argue in favour of unit tests, but
quite the contrary, as the beneficial effects of unit testing seem
pretty obvious to me (and to anybody who's ever used them).

> I think there could be a legitimate need for unit tests in C for
> some items, but it seems to me the reason would need to be pretty
> compelling if you hope to get broad interest and support from the other
> developers.
>

The reasons are:
- better code
- safer modifications
- more confidence
- regression testing
- automation of repetitive tasks
- integration in the build process

See for instance bug 1629: if we had unit tests we could have
committed the modifications to 4.8.1 already without having to recall
why in the first we made those changes in the first place.

> Currently it seems we have roughly as many test suite mechanisms as we
> have developers interested in using and supporting them.
>
> I imagine you ought to write an RFC proposal on your unittest approach
> before it is integrated into MapServer.
>

If that is necessary I'll do it, but I'd better code than write.

Umberto
> Best regards,
> --
> ---------------------------------------+--------------------------------------
> I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
> light and sound - activate the windows | http://pobox.com/~warmerdam
> and watch the world go round - Rush    | Geospatial Programmer for Rent
>
>



More information about the mapserver-dev mailing list