Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.programming > #5532
| Path | csiph.com!optima2.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!news2.arglkargh.de!news.swapon.de!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail |
|---|---|
| From | Richard Heathfield <rjh@cpax.org.uk> |
| Newsgroups | comp.programming |
| Subject | Re: How to write a test with random usage patterns? |
| Date | Tue, 28 Jul 2015 17:17:29 +0100 |
| Organization | go, ion artisan! |
| Lines | 48 |
| Message-ID | <mp89rt$t9l$1@dont-email.me> (permalink) |
| References | <hbf.20150727d459@bombur2.uio.no> <mp7oqm$ka3$1@dont-email.me> <hbf.20150728dboy@bombur.uio.no> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=windows-1252; format=flowed |
| Content-Transfer-Encoding | 7bit |
| Injection-Date | Tue, 28 Jul 2015 16:15:57 +0000 (UTC) |
| Injection-Info | mx02.eternal-september.org; posting-host="bbec9967c55d39f11ca29ee1f0b15ce1"; logging-data="30005"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX186xy57ejdhREQiT7VPdHboZ7FVEDSvANs1MHOSCpp1dw==" |
| User-Agent | Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 |
| In-Reply-To | <hbf.20150728dboy@bombur.uio.no> |
| Cancel-Lock | sha1:miIDtE+TQiQEC3yh7OQn1LCdDxw= |
| Xref | csiph.com comp.programming:5532 |
Show key headers only | View raw
On 28/07/15 14:03, Hallvard Breien Furuseth wrote: > Richard Heathfield <rjh@cpax.org.uk> writes: >> Find a way to express a test case as a sequence of bits, such that *any* >> sequence of bits represents a valid test case. Then generate a few >> hundred random bit sequences. Test them. If possible, identify the >> bitstrings that detect bugs, and flag them. Keep any that have the flag, >> and throw the rest out. Then generate new test cases as follows: > > That sounds pretty cool once we've found a bug. Good point. :-) In the meantime, you'd need a less finicky fitness function, wouldn't you? > Until then though, it > seems to be just the same as "switch (rand() % COUNT)" - there'll be no > patterns in the bit strings beyond random noise. At first, yes. This is typical of genetic algorithms - the interesting behaviour takes a while to emerge. > So the bit strings > don't help generate interesting test cases. I think you're correct at the start, but I also think they will help to generate /more/ interesting test cases (once you have some that are even mildly interesting), if you get your fitness function right. > That is, I'm hoping to > decompose "test cases" in small steps, then assemble them in more > interesting ways than just random order would achieve. > >> 1) take two test cases at random; >> 2) take a random number of bits from the first test case; >> 3) take a random number of bits from the second test case, and catenate; >> 4) repeat from 2) until you have a valid test case; > > I gather there's no need for (4) here, since you said any bit string is > a valid test case. Just making sure it's long enough, that's all - I assume (and it may not be necessary to assume, but probably simpler if you do) that a test case consists of precisely N bits. -- Richard Heathfield Email: rjh at cpax dot org dot uk "Usenet is a strange place" - dmr 29 July 1999 Sig line 4 vacant - apply within
Back to comp.programming | Previous | Next — Previous in thread | Find similar | Unroll 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