سؤال

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

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.

نصائح أخرى

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

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top