4.4. Summary

Random testing and feature testing complement each other, testing all the language features you can think of and testing valid language elements you might never think of. For random testing, you can use the ParserTester hierarchy in the sjm packages. You may need to override these classes if your parser requires a special tokenizer or a target. For feature testing, you should acquire a testing framework such as JUnit and use it to verify that your parser (still) has all the functionality you intend.

Get Building Parsers with Java™ now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.