Regenerate: A Language Generator for Extended Regular Expressions with an application to test case generation
Abstract
Regular expressions are part of every programmer's toolbox. They are used for a wide variety of language-related tasks and there are many algorithms for manipulating them. In particular, matching algorithms that detect whether a word belong to the language described by a regular expression is both a well explored area, yet one that still receives frequent contributions. However, there is no satisfactory solution for testing such matchers, which would require generating positive as well as negative examples for the language. We propose an algorithm to generate a language matched by a generalized regular expression with intersection and complement operators. The complement operator allows us to generate both positive and negative example words from a given regular expression. We implement our generator in Haskell and OCaml, and show that its performance is more than adequate for the purpose of testing.
Origin : Files produced by the author(s)
Loading...