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


Groups > comp.programming > #5518

How to write a test with random usage patterns?

Path csiph.com!optima2.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!newsfeed.straub-nv.de!newsfeed1.swip.net!uio.no!nntp.uio.no!.POSTED!not-for-mail
From Hallvard Breien Furuseth <h.b.furuseth@usit.uio.no>
Newsgroups comp.programming
Subject How to write a test with random usage patterns?
Date Mon, 27 Jul 2015 14:48:13 +0200
Organization University of Oslo, Norway
Lines 22
Message-ID <hbf.20150727d459@bombur2.uio.no> (permalink)
NNTP-Posting-Host bombur2.uio.no
Mime-Version 1.0
Content-Type text/plain; charset=us-ascii
X-Trace readme.uio.no 1438001293 32449 129.240.202.14 (27 Jul 2015 12:48:13 GMT)
X-Complaints-To abuse@uio.no
NNTP-Posting-Date Mon, 27 Jul 2015 12:48:13 +0000 (UTC)
User-Agent Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)
Cancel-Lock sha1:8S9W6+5TAL7TzPuwm176nmHpf18=
Xref csiph.com comp.programming:5518

Show key headers only | View raw


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;
    ...
  }

That is, anti_rand() might output random numbers for a while, then
switch to (X,Y,Z, X,Y,Z ...) for a while, and so on.

The point is to avoid coding up some particular patterns like
"write descending keys for a while", and instead have anti_rand()
cause that.  What's a good way to write anti_rand()?  How to use
it well?  Or should I ask, what should I goolge for?  I expect
someone has dealt with this problem before.

-- 
Hallvard

Back to comp.programming | Previous | Next — 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