A Sentence Generation Algorithm for Testing Grammars

作者:Zheng Lixiao*; Wu Duanyi
来源:IEEE 33rd International Computer Software and Applications Conference, United States,Washington, 2009-07-20 to 2009-07-24.
DOI:10.1109/COMPSAC.2009.193

摘要

One simple approach to testing grammars is to derive a number of sentences from the grammar under test and to validate whether they comply with the intended language. Purdom has proposed a by-now folklore sentence generation algorithm which however suffers from the fact that the sentences generated are usually too few and some of them are long with complicated derivation structures. In this paper we present an improved algorithm which incorporates a length control mechanism into the generation process to produce more and simpler sentences. Experiments demonstrate that besides the benefits for user validation and error location, our algorithm is also helpful in highlighting more errors in some cases.

  • 出版日期2009
  • 单位中国科学院

全文