> I would also add a crosstesting several functions with known identity. 

Good idea. 


>Well, my "trivialcase-tester" is just those few lines of code. But as you 
> can see from https://trac.sagemath.org/ticket/21741 
<https://www.google.com/url?q=https%3A%2F%2Ftrac.sagemath.org%2Fticket%2F21741&sa=D&sntz=1&usg=AFQjCNHOFlfe-YW8rN7vz7PBGr4aQuSa_w>
 
, it found quite many 
> error from graphs.

That is not surprising for me. Maybe it is surprising for non-testers ;-)

My code to catch bugs in Singular for groebner basis in Polynomial rings 
over integers was something like:

randomIdeal = generateRandomIdeal();
groebnerBase = groebner(randomIdeal );
groebnerBaseOnceAgain = groebner(groebnerBase);
checkResultEquivalence (groebnerBase, groebnerBaseOnceAgain);

But, If you catched issues for non-corner cases, the challenge is often to 
find a minimal/simple failing example,
which is often necessary for successful debugging.

>Should have a list of corner cases? I don't know if that would be easy to 
>do or not, something like modulename._cornercases() or so. 

I would expect that you will need corner cases per function and per data 
type (graph, Ideal, prime number...)

>In matrices I did not found that many errors, but I 
>only tested integer matrices. 

I recommend that you continue test sage library functions which you use in 
your own research projects,
or functions where you already found bugs or expect that they are 
improperly coded.

But probably you should not do that, you may get unpleasantly surprised...



Am Montag, 31. Oktober 2016 10:31:56 UTC+1 schrieb Jori Mäntysalo:
>
> On Mon, 31 Oct 2016, Jakob Kroeker wrote: 
>
> > So you have a mind of a tester? That's good to  know.  
>
> Well, my "trivialcase-tester" is just those few lines of code. But as you 
> can see from https://trac.sagemath.org/ticket/21741 , it found quite many 
> error from graphs. In matrices I did not found that many errors, but I 
> only tested integer matrices. 
>
> Should have a list of corner cases? I don't know if that would be easy to 
> do or not, something like modulename._cornercases() or so. 
>
> > In general I think it would be good to have a random testing framework  
> > together with a testbot in sage. 
>
> Yes, could be useful. 
>
> > Maybe you are also interested in the slides from my presentation about 
> bug hunting and bug preventing 
> > on 
> > https://wiki.sagemath.org/days66 
>
> Good slides. 
>
> I would also add a crosstesting several functions with known identity. For 
> example 
>
> len(list(Posets(4))) == len([g for g in digraphs(4) if 
> g.is_directed_acyclic() and g.is_transitively_reduced()]) 
>
> (I.e. a poset can be seen as just a special case for directed graph.) 
>
> or 
>
> Posets.RandomPoset(10, 0.1).order_ideals_lattice().is_modular() 
>
> (Every order ideal lattice is a distributive lattice and every 
> distributive lattice is modular.) 
>
> etc. 
>
> -- 
> Jori Mäntysalo

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to