[antlr-interest] Syntax based testing for ANTLR grammars?

Mike Lischke mike at lischke-online.de
Thu Sep 20 08:53:10 PDT 2012


What I wonder is if this way test is really meaningful. I mean, when you create test sentences from the grammar they will always work, no? Since your parser uses the same grammar as the test input stems from there can only be test failures if your grammar uses actions to control what gets parsed how. But for a pure grammar you can only generate test cases when you take your language spec (not codified in a grammar) and create test cases out of it.

> I did some work on my own on this a year ago and the problem you get into
> is a huge explosion in output. Just to manage the problem of the explosion
> I had to create methods just to count the possibilities given a grammar and
> the easiest way for me to relate to the size was as a power. So for one
> grammar the set could have 10**15 results and others could have 10**30
> results. This is not even something that can be reasonably tested.
> 
>> 
>> Is anyone aware of any projects out there for doing syntax-based
>> testing using ANTLR grammars?  The simplest form would be a tool for
>> generating valid language productions from an ANTLR grammar, but more
>> complex might introduce mutations.
>> 
>> 
>> Thanks
>> Mike Barry
>> 
>> List: http://www.antlr.org/mailman/listinfo/antlr-interest
>> Unsubscribe:
>> http://www.antlr.org/mailman/options/antlr-interest/your-email-address
>> 
> 
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address

Mike
-- 
www.soft-gems.net




More information about the antlr-interest mailing list