-----BEGIN PGP SIGNED MESSAGE-----

Moin,

On 02-Aug-02 Nicholas Clark carved into stone:
> On Fri, Aug 02, 2002 at 08:16:17AM +0200, Janek Schleicher wrote:
>> Ilya Martynov wrote at Fri, 02 Aug 2002 07:42:44 +0200:
>> 
>> >>>>>> On Wed, 31 Jul 2002 21:52:17 +0200, Janek Schleicher
>> >>>>>> <[EMAIL PROTECTED]> said:
>> > 
>> > JS> [..snip..]
>> > 
>> > JS> Thinking in general,
>> > JS> there could be also some other features included.
>> > JS> Let's think we'd like to test the creation of big pictures,
>> > JS> perhaps 5_000 x 5_000.
>> > JS> It could take a while to make a test for all pixels,
>> > JS> but we also would like to test some of them (randomly choosen),
>> > JS> to avoid systematic error.
>> > 
>> > Test results should be easily reproducible. I don't think having
>> > randomly choosen tests is good idea.
> 
> I think having randomly chosen repeatable tests is an excellent idea.
> Over the course of many people making many test runs explore far more
> of parameter space than any single systematic test permutation device
> could hope to achieve.

[snip a lot of nice text]

> 
>> srand could be our friend.
> 
> Which is how I'm doing it at work now.
> I call srand with a random number. (I'm getting mine from /dev/urandom,
> but I suspect that calling rand() and using that to prime srand will
> achieve sufficient randomness for these purposes. (ie you get to run one
> of 65536 sequences, which is better than running 1 of 1 sequence)

rand() is 48 bits on Linux, not 32, right? ;) So it is even better ;)

> This is the problem that I have, and I think I've found a solution that
> works for me.

I also do this in Math::BigInt's testsuite (suggestion by Paul Green) and it
is really nice; systematic tests almost always fail to address the more
strange cornercases that your forgot to put in the list of things to
test. 

Random testing really finds these obscure bugs, especially when your code
done by the tests is non-trivial.

Cheers,

Tels


- -- 
 perl -MDev::Bollocks -e'print Dev::Bollocks->rand(),"\n"'
 conveniently revolutionize one-to-one action-items

 http://bloodgate.com/perl       My current Perl projects
 PGP key available on http://bloodgate.com/tels.asc or via email

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: When cryptography is outlawed, bayl bhgynjf jvyy unir cevinpl.

iQEVAwUBPUqbZncLPEOTuEwVAQESeAf8CHZlCYgPZCb5zYwvIhpay5fKJAMDoWuM
sDac8AIJ24u+z1TIaW8273z/sPmW7OjC9/oQDDdro7aVo+WRsGYpG+roOsGIbcj0
V9+o/RNMDzDyX/Rxcn0kCdmhCgqf9L4af/dX/xciXRJEvzkAsyYSVbVjkrvUy+F7
gEC9r1GkLXH7dKPiNaYjyLEGwN5ccPV8KZb88l1C/lcKc7M26prd0bm9M9Py7LZW
i3AUvAitxqCmrTq2bPtc4WGwYk2qaC/bn6GcudDQgvhgO4HhdvTJZc/Sn/Ltl1qm
2uI9qKDe6GFsntgQWRXrznhnuVIk9ZPO45zCQ/yNIVlMnPY4Mn5YWQ==
=vFF/
-----END PGP SIGNATURE-----

Reply via email to