- From: Travis Leithead <travis.leithead@microsoft.com>
- Date: Fri, 21 Dec 2012 18:36:56 +0000
- To: Dominique Hazael-Massieux <dom@w3.org>, "public-script-coord@w3.org" <public-script-coord@w3.org>, Cameron McCormack <cam@mcc.id.au>
- CC: "public-webapps-testsuite@w3.org" <public-webapps-testsuite@w3.org>
Filed https://www.w3.org/Bugs/Public/show_bug.cgi?id=20481 ...with this feedback, plus other feedback I was coincidentally going to send today as well :-) > -----Original Message----- > From: Dominique Hazael-Massieux [mailto:dom@w3.org] > Sent: Friday, December 21, 2012 9:39 AM > To: public-script-coord@w3.org > Cc: public-webapps-testsuite@w3.org > Subject: Generating random WebIDL fragments from grammar > > Hi, > > As a way to test both my WebIDL parser [1] and the WebIDL grammar, I've > been looking at generating random but valid fragments from the WebIDL > grammar. > > To that end, I've been using abnfgen: > http://www.quut.com/abnfgen/ > > Since abnfgen only takes ABNF as input, I've written a quick and dirty > script (attached) that converts the grammar as defined in the WebIDL > spec (when copied and pasted in a text file) into an ABNF grammar. > > It does mostly syntax conversion from one grammar to the other, although > it also does a few tweaks in order to generate more useful test cases. > > The grammar that it currently generates is buggy, because the grammar in > the WebIDL spec is buggy; attached is a ABNF grammar that more closely > matches what I think WebIDL intends. > > Using that grammar, I can generate a bunch of random WebIDL fragments, > e.g. with: > for i in `seq 1 150` ; do abnfgen webidl.bnf > test$i.idl ; done > which I then run against my parser: > for i in *.idl ;do widlproc $i 1>/dev/null ; done > > This has proved pretty useful in finding bugs in my implementation, as > well as bugs in the grammar, so I thought I would share it. > > (I've already modified a number of test cases in the widlproc repository > as a result of this work) > > Dom > > 1. https://github.com/dontcallmedom/widlproc
Received on Friday, 21 December 2012 18:38:11 UTC