|
Boost : |
From: Jeremy Siek (jsiek_at_[hidden])
Date: 2002-01-29 14:51:17
Righto. It would be good to add this to the docs, perhaps with some
additional examples that show what a good data-set is for a particular
comparison function, and what a bad data-set is, and why. Perhaps you can
firm things up by giving definitions or examples of things like
"representative" input, "equivalent" values, etc. (well, you can probably
just link to a def. for equivalent, but some more examples would be good)
Great work!
Cheers,
Jeremy
On Tue, 29 Jan 2002 jpanzer_at_[hidden] wrote:
jpanze> Ah! OK, I understand. test_strict_weak_ordering does an exhaustive test of all the input values against
jpanze> each other using the functor, and the original order of the input doesn't matter. If the input contains
jpanze> all possible values for value_type, then test_strict_weak_ordering will give a definitive yes/no answer.
jpanze>
jpanze> Otherwise, and for most real-world cases, it will give a false positive if the input doesn't contain a
jpanze> case that causes a failure (a true return just means that it can't prove the functor is broken). So the
jpanze> quality of the answer depends on the quality of the input; this is the usual test data problem. So there
jpanze> isn't really a precondition, but rather a tradeoff between exhaustiveness of testing and certainty of
jpanze> correctness. There are some things to keep in mind:
jpanze>
jpanze> - There's no reason to repeat exact values, but it can be helpful to have some equivalent values (where
jpanze> equivalence is defined in terms of the comparison functor).
jpanze> - Using representative input is important.
jpanze> - Edge cases are good tests, but requires detailed knowledge of how the comparison works.
jpanze>
jpanze> John Panzer
jpanze>
jpanze>
jpanze>
jpanze> Jeremy Siek wrote:
jpanze>
jpanze> > In addition to the compile-time requirements, I bet there are also some
jpanze> > run time requirements. For example, a list of the same object over and
jpanze> > over again probably wouldn't work for input, right?
jpanze> >
jpanze> > On Mon, 28 Jan 2002 jpanzer_at_[hidden] wrote:
jpanze> > > Hi Jeremy-
jpanze> > >
jpanze> > > The value_type must be copy constructible and (of course) must be
jpanze> > > compatible with the argument types of the predicate under test.
jpanze> > > Also, for this version, it must have some appropriate operator<<
jpanze> > > defined for stream output. (All the requirements are detailed in the
jpanze> > > header file in this draft. If this proves to be of interest, I'm sure
jpanze> > > the last requirement can be made optional.)
jpanze> > >
jpanze> > > -John
jpanze> > >
jpanze> > > Jeremy Siek wrote:
jpanze> > >
jpanze> > > > Hi John,
jpanze> > > >
jpanze> > > > This is great!
jpanze> > > >
jpanze> > > > BTW, I assume that there are some preconditions on the data set. What are
jpanze> > > > they?
jpanze> > > >
jpanze> > > > On Mon, 28 Jan 2002, johnrpanzer wrote:
jpanze> > > > jpanze> All,
jpanze> > > > jpanze>
jpanze> > > > jpanze> Many moons ago, I asked if there would be any interest
jpanze> > > > jpanze> in something to do runtime concept checking (at least
jpanze> > > > jpanze> for ordering predicates). One or two people expressed
jpanze> > > > jpanze> some mild curiosity, so as part of my New Year's resolutions,
jpanze> > > > jpanze> I've uploaded a draft implementation of an ordering
jpanze> > > > jpanze> predicate checker to:
jpanze> > > > jpanze>
jpanze> > > > jpanze> http://groups.yahoo.com/group/boost/files/test_strict_weak_ordering/
jpanze> > > > ...
jpanze> > >
jpanze> > >
jpanze> > > Info: http://www.boost.org Send unsubscribe requests to: <mailto:boost-unsubscribe_at_[hidden]>
jpanze> > >
jpanze> > > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
jpanze> > >
jpanze> > >
jpanze> >
jpanze> > ----------------------------------------------------------------------
jpanze> > Jeremy Siek http://www.osl.iu.edu/~jsiek/
jpanze> > Ph.D. Student, Indiana Univ. B'ton email: jsiek_at_[hidden]
jpanze> > C++ Booster (http://www.boost.org) office phone: (812) 855-3608
jpanze> > ----------------------------------------------------------------------
jpanze> >
jpanze> > Info: http://www.boost.org Send unsubscribe requests to: <mailto:boost-unsubscribe_at_[hidden]>
jpanze> >
jpanze> > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
jpanze>
jpanze>
jpanze> Info: http://www.boost.org Send unsubscribe requests to: <mailto:boost-unsubscribe_at_[hidden]>
jpanze>
jpanze> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
jpanze>
jpanze>
----------------------------------------------------------------------
Jeremy Siek http://php.indiana.edu/~jsiek/
Ph.D. Student, Indiana Univ. B'ton email: jsiek_at_[hidden]
C++ Booster (http://www.boost.org) office phone: (812) 855-3608
----------------------------------------------------------------------
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk