Grammar Testing

  title={Grammar Testing},
  author={Ralf L{\"a}mmel},
  • R. Lämmel
  • Published in FASE 2 April 2001
  • Computer Science
Grammar testing is discussed in the context of grammar engineering (i.e., software engineering for grammars). We propose a generalisation of the known rule coverage for grammars, that is, context-dependent branch coverage. We investigate grammar testing, especially coverage analysis, test set generation, and integration of testing and grammar transformations. Grammar recovery is chosen as a subfield of grammar engineering to illustrate the developed concepts. Grammar recovery is concerned with… 
A Systematic Framework for Grammar Testing
  • Lixiao Zheng, H. Chen
  • Computer Science, Materials Science
    2009 Eighth IEEE/ACIS International Conference on Computer and Information Science
  • 2009
This paper proposes a nonterminal-based approach for grammar modularization, combined with an iterative process for grammar testing in which a grammar is tested with respect to both a generator and a recognizer.
A Case Study in Grammar Engineering
A grammar of industrial strength, in the sense that it is well-tested, it can be used for fast parsing of high volumes of code, and it allows automatic generation of support for syntax tree representation, traversal, and interchange.
Comparison of Context-Free Grammars Based on Parsing Generated Test Data
An automated approach is developed that is practically useful in revealing evidence of nonequivalence of grammars and discovering correspondence mappings for grammar nonterminals and two studies are discussed that show how the approach is used in comparing Grammars of open source Java parsers as well as grammARS from the course work for a compiler construction class.
Analysing the effectiveness of rule-coverage as a reduction criterion for test suites of grammar-based software
This work finds that when grammar rule coverage is used as the sole criterion for reducing test suites of grammar based software, the fault detection capability of that reduced test suite is greatly diminished when compared to other coverage criteria such as statement coverage.
An analysis of rule coverage as a criterion in generating minimal test suites for grammar-based software
This paper proposes a strategy for the construction of test suites for grammar based software, and illustrates this strategy using the ISO CPP grammar, and uses the concept of rule coverage as a pivot for the reduction of implementation-based and specification-based test suites.
Toward an engineering discipline for grammarware
This work identifies the problems with the current grammarware practices, the barriers that currently hamper research, and the promises of an engineering discipline for grammarware, its principles and the research challenges that have to be addressed.
Test criteria for context-free grammars
  • Hu Li, Maozhong Jin, Chao Liu, Z. Gao
  • Computer Science
    Proceedings of the 28th Annual International Computer Software and Applications Conference, 2004. COMPSAC 2004.
  • 2004
A family of grammar-based structural test criteria whose subsume relations and test set sizes are analyzed, which are used to assess the formalization of the test adequacy criterion for context-free grammars.
Automatic grammar repair
We describe the first approach to automatically repair bugs in context-free grammars: given a grammar that fails some tests in a given test suite, we iteratively and gradually transform the grammar
Grammar Recovery from Parse Trees and Metrics-Guided Grammar Refactoring
This paper describes a methodology for grammar recovery from a hard-coded parser that is comprised of manual instrumentation of the parser, a technique for automatic grammar Recovery from parse trees, and a semi-automatic metrics-guided approach to refactoring an iterative grammar to obtain a recursive grammar.
Systematically Covering Input Structure
  • Nikolas Havrikov, A. Zeller
  • Computer Science
    2019 34th IEEE/ACM International Conference on Automated Software Engineering (ASE)
  • 2019
The k-path algorithm for grammar production systematically covers syntactic elements as well as their combinations, which results in a significantly higher code coverage than state of the art.


A sentence generator for testing parsers
A fast algorithm is given to produce a small set of short sentences from a context free grammar such that each production of the grammar is used at least once. The sentences are useful for testing
Semi‐automatic grammar recovery
This work provides a structured process to recover grammars including the adaptation of raw extracted Grammars and the derivation of parsers and was the first to publish a (Web‐enabled) grammar specification so that others can use this result to construct their own grammar‐based tools for VS COBOL II or derivatives.
Compiler test suite: evaluation and use in an automated test environment
Grammars as contracts
An instantiation of the architecture for the syntax definition formalism SDF is discussed, integrating both existing and newly developed meta-tools that support SDF, and the A Term format is adopted as exchange format.
The automated generation of test cases for compilers
  • C. Burgess
  • Computer Science
    Softw. Test. Verification Reliab.
  • 1994
This paper seeks to review the main methods that have been proposed for the automation of part of the testing of a compiler, using the automatic generation of test cases and the automatic checking of the results.
Automatic Generation of Random Self-Checking Test Cases
Implementations of the technique that have been used to test various IBM programs-- PL/I language processors, sort/merge programs, and Graphical Data Display Manager alphanumeric and graphics support are described.
Weak Mutation Testing and Completeness of Test Sets
  • W. Howden
  • Computer Science
    IEEE Transactions on Software Engineering
  • 1982
An error-based method called weak mutation testing is described, in which tests are constructed which are guaranteed to force program statements which contain certain classes of errors to act incorrectly during the execution of the program over those tests.
Development, assessment, and reengineering of language descriptions
  • A. Sellink, C. Verhoef
  • Computer Science
    Proceedings of the Fourth European Conference on Software Maintenance and Reengineering
  • 2000
Tools that aid in the development, the assessment and the reengineering of language descriptions are discussed and a language standard without syntax error in the language description and its code examples is developed.
The syntax definition formalism SDF—reference manual—
SDF is a formalism for the definition of syntax which is comparable to BNF in some respects, but has a wider scope in that it also covers the definition of lexical and abstract syntax. Its design and
Current parsing techniques in software renovation considered harmful
  • M. Brand, A. Sellink, C. Verhoef
  • Computer Science
    Proceedings. 6th International Workshop on Program Comprehension. IWPC'98 (Cat. No.98TB100242)
  • 1998
It is concluded that current technology may cause problems for the reengineering industry and that modular and/or compositional parsing techniques are a possible solution.