Build a program that generates test sentences for any given BNF satisfying the c

Build a program that generates test sentences for any given BNF satisfying the criterion of syntax-driven testing augmented according to point c of Exercise 6.53. Exercise 53 Notice the similarity between the syntax-driven testing criterion and the statement-coverage criterion by simply considering syntactic productions instead of statements. In some sense, syntax-driven testing suffers from similar weaknesses as statement coverage. For instance, suppose that a compiler uses at most k temporary cells to evaluate arithmetic expressions. During the compilation, it keeps a counter of the number of cells used, and after using the kth cell, it starts again from theĀ  first cell, without checking whether the cell is still in use. a. Assume that arithmetic expressions are described by the grammar of Example 6.7. b. For several values of k, give examples of expressions satisfying the syntax-directed criterion that fail to expose the error in the compiler. c. Augment the testing criterion by using similar approaches to the way the corresponding white-box criterion has been strengthened in Section 6.3.4.1, in order to allow the detection of erroneous overwriting of a cell and of other errors.

You may also like