[pgrouting-dev] Writing unittests for SQL functions
Daniel Kastl
daniel at georepublic.de
Tue Apr 19 20:54:14 EDT 2011
Hi Kishore,
That's a great idea!
I had actually made a ticket for unit tests some time ago:
https://github.com/pgRouting/pgrouting/issues/20
So far nobody has done anything of course. Tickets only don't get anything
done ;-)
I hope Anton or someone else can give some better answer, because I don't
know well about this topic.
Have you looked at how PostGIS is doing it? There is some chance that
pgRouting and PostGIS will merge (someday), so then it would be good to have
something that fits already.
One important point is in my opinion to have some suitable network graph for
testing.
Something that can cover all test cases and can eventually give some visual.
Daniel
<https://github.com/pgRouting/pgrouting/issues/20>
2011/4/20 Kishore Kumar <justjkk at gmail.com>
> Hi,
>
> I was exploring on ways to improve the pgrouting codebase and make it
> suited for easier development. It struck me that writing unittests for all
> the pgrouting functions will help with both documentation as well as reduce
> the overhead of manual testing. Initially I tried using google's c++ testing
> framework[1] to test the c and c++ functions but encountered problems
> because the c functions were using postgresql library and decoupling psql
> interactions from the core algorithm seemed too much of a rewrite for
> testing.
>
> Hence, I resolved to implementing black box testing of individual SQL
> functions. Since this can be done independent of the language constraints, I
> explored opportunities with using python. I found python's unittest
> framework to be both light and flexible for the purpose. The initial
> attempts can be found in my python_unittests branch[2].
>
> The problem I'm facing is to run the tests between 'make' and 'make
> install' stages. Currently, the tests are run against the installed version
> of pgrouting found at $libdir so that testing can be done only after
> installing.
>
> Will be glad to hear any problems with the current choice of tools or if
> the testing approach needs to be changed.
>
> --
> Regards,
> J Kishore Kumar.
>
> [1] - http://code.google.com/p/googletest/
> [2] - https://github.com/justjkk/pgrouting/commits/python_unittests
>
>
> _______________________________________________
> pgrouting-dev mailing list
> pgrouting-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/pgrouting-dev
>
>
--
Georepublic UG & Georepublic Japan
eMail: daniel.kastl at georepublic.de
Web: http://georepublic.de
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/pgrouting-dev/attachments/20110420/ecd11c4d/attachment.html
More information about the pgrouting-dev
mailing list