1

Is there a complete series tests to test if a GLR parser is correctly written?

I'am writing a GLR parser, so I want to find some tests for my code. I can't figured out a complete test suit by my self because of some missing conditions perhaps.

I've already written some tests to test the parser. But I don't know if it will fail on other conditions. So I need "a complete test", may be a lot of people adding test cases to the test. That could promise the parser can handle any cases. GLR parser can handle any context-free grammar, so a lot of conditions are needed to be tested.

qdwang
  • 425
  • 1
  • 4
  • 13
  • I'm not familiar with the subject, but you might get a response if your question where more detailed. It seems like a pretty big question for only two sentences. – DavidS Apr 01 '15 at 18:45
  • I'am writing a GLR parser, so I want to find some tests for my code. I can't figured out a complete test suit by my self because of some missing conditions. – qdwang Apr 04 '15 at 03:18
  • "If you haven't tested it, then it doesn't work" - Saunders. – John Saunders Apr 04 '15 at 03:23
  • So, ignore the fact that it's a GLR parser, and just write tests for the code you wrote. If you had written the code using TDD, then you would know it works because all the tests would pass. Is there something about a GLR parser that would prevent it being developed using TDD? – John Saunders Apr 04 '15 at 03:24
  • I've already written some tests to test the parser. But I don't know if it will fail on other conditions. So I need "a complete test", may be a lot of people adding test cases to the test. That could promise the parser can handle any cases. GLR parser can handle any context-free grammar, so a lot of conditions are needed to be tested. – qdwang Apr 04 '15 at 04:00
  • You might consider using a test coverage tool, to verify that all blocks of code in the GLR parser have been exercised. That won't prove that it handles all possible context-free grammars correctly, but it will demonstrate that your tests at least exercise everything in the parser. – Ira Baxter Apr 04 '15 at 07:39

0 Answers0