#14284: Sampling in unit tests
-------------------------------+--------------------------------------------
       Reporter:  roed         |         Owner:  jason       
           Type:  enhancement  |        Status:  needs_work  
       Priority:  major        |     Milestone:  sage-5.9    
      Component:  misc         |    Resolution:              
       Keywords:               |   Work issues:              
Report Upstream:  N/A          |     Reviewers:  Julian Rueth
        Authors:  David Roe    |     Merged in:              
   Dependencies:  #14285       |      Stopgaps:              
-------------------------------+--------------------------------------------
Changes (by roed):

  * status:  positive_review => needs_work


Comment:

 Replying to [comment:9 nthiery]:
 > Hi!
 >
 > Sorry to jump in a bit late in the discussion; I had not noticed this
 ticket before.

 Well, we did just open it a couple days ago (Julian's visiting me in
 Calgary so we're working in person).

 > I definitely see and approve the point of the ticket. On the other hand,
 I find the current idiom to be used in {{{_test_associativity}}} and
 friends a bit heavy. What about an idiom like:
 >
 > {{{
 >     S = tester.some_elements()
 >     for x,y,z in tester.some_elements(CartesianProduct(S,S,S)):
 >         ...
 > }}}
 >
 > It's short, and encapsulate TestSuite's inner logic for testing
 strategies (on how many elements to run the tests, whether to do tests at
 random or not, ...).
 >
 > This of course requires implementing:
 > {{{
 > tester.some_elements(XXX)
 > }}}
 >
 > The default implementation could be to run XXX.some_elements(). Or
 iterate through XXX, stopping if there are more than n_max elements. Or
 take a sample if XXX implements sample. Or ...
 >
 > What do you think? If you agree, then I would suggest doing the changes
 in this ticket, in order to minimize changes and counter changes (they
 probably will require some rebasing of my upcoming category patches; the
 less rebasing the better :-)).

 Sounds okay to me: I'll make a new version.  There will be a couple tests
 that can't use this idiom (`_test_eq_symmetric` for example), but they can
 certainly use the current approach.
 >
 > By the way: for reproducibility of test failures, I am not super
 comfortable with random testing as a default; but that might be just me.

 Since Sage sets the random seed at the beginning of each run, tests that
 use randomness should be reproducible....

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/14284#comment:10>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to