Re: compiler/translator testing techniques

Scott Moore <>
5 Apr 2003 15:04:53 -0500

          From comp.compilers

Related articles
compiler/translator testing techniques (Ruslan Vorobey) (2003-03-30)
Re: compiler/translator testing techniques (Christopher Glaeser) (2003-03-30)
Re: compiler/translator testing techniques (Ruslan Vorobey) (2003-03-31)
Re: compiler/translator testing techniques (Scott Moore) (2003-04-05)
Re: compiler/translator testing techniques (Christopher Glaeser) (2003-04-05)
| List of all articles for this month |

From: Scott Moore <>
Newsgroups: comp.compilers
Date: 5 Apr 2003 15:04:53 -0500
Organization: AT&T Broadband
References: 03-03-160 03-03-193 03-03-202
Keywords: testing
Posted-Date: 05 Apr 2003 15:04:52 EST

> > For a link to compiler performance testing, see
> > [If you're serious about testing, it's a lot cheaper to buy a serious
> > test suite from a company like Nullstone than to try to concoct your
> > own. -John]
> Thank you for link, I'll investigate it.
> The question concerned not really performance (but it also very
> important) but approaches to verify ready compiler created with
> lex/yacc pair or fully custom how it conform to customer's
> requirements. Really technique to create testing environments,
> testcases, what should be tested first etc.
> I think this question to people with some experience in creating
> _industrial_ translators/compilers.

The various techniques I have seen are:

1. Sutes, collected statements designed to test all reasonable
constructs and corner cases.

2. Simply running on many large programs known to be correct.

3. Test cases that are automatically generated by program (like a
program with impossibly deep nested calls, etc).

4. Fault injection, example, taking an existing large program and
taking out each sucessive tolken in the program and compiling it, or
adding a noise tolken between each tolken, then logging the number of
errors resulting. This finds error cases that cause error recovery to

THats the ones I know. Observation, most testing is fairly ad-hoc.

PJ Brown from a long time ago, avocates feeding the compiler the wrong
language (!) to see if it recovers.

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.