Query: GMP completeness testing

Sam Rawlins sam.rawlins at gmail.com
Fri Jun 25 18:36:25 CEST 2010


Hi Brad,

Very exciting to see another port!

I maintain (using that term loosely :/) GMP bindings for Ruby. How I
initially began to create unit tests was just to test each new function as
it was ported. This is very incomplete, however, because I am almost
certainly missing the edge cases that the GMP team identifies as they write
and update the functions.

My next step is to quite simply read through the test files and virtually
port them into Ruby Test::Unit scripts. This is absurdly long and tedious.
I'm not sure I recommend it, but I am doing it more as an exercise in
learning the internals of GMP and MPFR. Also I find it interesting and
challenging to port code from C to Ruby efficiently, so this has become more
of a hobby than a serious excursion into properly testing the bindings.

On Thu, Jun 24, 2010 at 5:31 PM, Brad Chamberlain <bradc at cray.com> wrote:

>
> Hi GMP community --
>
> [Please feel free to respond to me directly or point me to the right part
> of the manual or an existing thread if this is a commonly-asked question. (I
> did some searching, but didn't come up with anything).]
>
> I am part of a team at Cray Inc. that is developing a new parallel
> programming language called Chapel.  One of our goals is to support
> interoperability with existing languages to avoid rewriting existing
> libraries.  By requests from our user community, we have identified GMP as
> one of the first external libraries to try and support via interoperability.
>  As of a few hours ago, we have a Chapel port of the gmp-chudnovsky.c
> program up and running by describing the relevant GMP types and functions
> using our extern capability.  (Chapel currently takes a source-to-C
> compilation approach, so interoperating with C is easier than most
> languages).
>
> As a next step, we'd like to flesh out this prototype to cover all GMP
> types and functions, not just those used by gmp-chudnovsky.  Given the
> effort required to convert any given test written in C into Chapel and the
> sheer number of tests in your source tree, I was curious if there are any
> individual tests that cover the full breadth of the interface, presumably
> without testing any single routine in as many permutations as one would
> ultimately want.  Porting such a test would give us some degree of
> confidence that we at least had covered the complete API.
>
> More generally, I'm curious how the other language efforts that have
> provided GMP interfaces (as itemized in your manual) have dealt with
> completeness/correctness testing in case there are lessons learned there
> that would be helpful to us.
>
> Thanks very much for any pointers and information.  And thanks for creating
> such an interesting and useful open source package.
>
> -Brad Chamberlain
> http://chapel.cray.com/
> https://sourceforge.net/projects/chapel/
> _______________________________________________
> gmp-discuss mailing list
> gmp-discuss at gmplib.org
> https://gmplib.org/mailman/listinfo/gmp-discuss
>



-- 
Sam Rawlins


More information about the gmp-discuss mailing list