Unit tests for various concrete syntax -> parse tree mappings are a great way. Then do same for sample input phrases -> translation or evaluation or whatever your app is. High code coverage in the generated parser corresponds to high grammar rule coverage.
Unit/Automated test guidelines for language created with ANTLR
-
21-06-2023 - |
문제
For a small language with minimal flow control, written with ANTLR, are there any guidelines or references that could be taken into consideration when testing the language?
Thanks
해결책 2
다른 팁
as an input parameter for tests, you can use a syntax files (whole or parts if you can) and then check if your data structures contains expected values (declared variables, procedures, types etc). but at the end you will still have to create a lot of different programs in your new language, run them and check if they provide correct result or interact with your IO abstraction
제휴하지 않습니다 StackOverflow