Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.programming > #5520

Re: How to write a test with random usage patterns?

Newsgroups comp.programming
Date 2015-07-27 07:42 -0700
References <hbf.20150727d459@bombur2.uio.no>
Message-ID <52b2f969-e287-449a-adf5-b9a958e77227@googlegroups.com> (permalink)
Subject Re: How to write a test with random usage patterns?
From Julio Di Egidio <julio@diegidio.name>

Show all headers | View raw


On Monday, July 27, 2015 at 1:48:18 PM UTC+1, Hallvard Breien Furuseth wrote:
> I want to test a database by throwing random usage patterns
> at it.  Maybe like this, but replacing rand() with something
> which exhibits random patterns in the output:
> 
> for (...)
>   switch (anti_rand() % CASES) {
>     case 0: foo();                     break;
>     case 1: bar(randomly chosen data); break;
>     ...
>   }

Also, on a more general note, while you do not want to write and maintain millions of tests, tests that are too complex (too coarse-grained) are ineffective, i.e. when they fail you do not get enough information to pin down the problem...

Julio

Back to comp.programming | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

How to write a test with random usage patterns? Hallvard Breien Furuseth <h.b.furuseth@usit.uio.no> - 2015-07-27 14:48 +0200
  Re: How to write a test with random usage patterns? Julio Di Egidio <julio@diegidio.name> - 2015-07-27 07:19 -0700
    Re: How to write a test with random usage patterns? Hallvard Breien Furuseth <h.b.furuseth@usit.uio.no> - 2015-07-27 17:00 +0200
      Re: How to write a test with random usage patterns? Julio Di Egidio <julio@diegidio.name> - 2015-07-27 08:42 -0700
        Re: How to write a test with random usage patterns? Hallvard Breien Furuseth <h.b.furuseth@usit.uio.no> - 2015-07-28 12:53 +0200
  Re: How to write a test with random usage patterns? Julio Di Egidio <julio@diegidio.name> - 2015-07-27 07:42 -0700
  Re: How to write a test with random usage patterns? Hallvard Breien Furuseth <h.b.furuseth@usit.uio.no> - 2015-07-28 12:55 +0200
  Re: How to write a test with random usage patterns? Richard Heathfield <rjh@cpax.org.uk> - 2015-07-28 12:26 +0100
    Re: How to write a test with random usage patterns? Julio Di Egidio <julio@diegidio.name> - 2015-07-28 05:20 -0700
    Re: How to write a test with random usage patterns? Hallvard Breien Furuseth <h.b.furuseth@usit.uio.no> - 2015-07-28 15:03 +0200
      Re: How to write a test with random usage patterns? Richard Heathfield <rjh@cpax.org.uk> - 2015-07-28 17:17 +0100

csiph-web