Skip to content

Help the User

Dave Nicolette edited this page Feb 10, 2021 · 1 revision

Home -> Developer Guide ->

When Cobol Check is able to detect a malformed Test Case, throw and log and halt processing so the user can correct their test suite. It may not always be possible for Cobol Check to detect this condition.

Users of the proof of concept project have reported that any minor error in defining a test case causes the tool to get confused. No helpful error messages are produced, and the test execution run continues in an invalid state. If you had more than a few lines of test code, it would quickly become difficult to locate mistakes in defining test cases.

Example: A user may forget to write End-Mock to terminate a Mock definition. Without End-Mock, Cobol Check has no clear way to know when it has read all the Cobol statements the user has written to express the desired behavior of the mocked resource. The proof of concept just went on parsing without making any attempt to check the context. The result may have been no output at all, invalid output, or an unhelpful exception that the user had no way to diagnose.

In Cobol Check, we want to look for signs that we have gone through all the statements related to the Mock. We can check for any Cobol Check keyword that would not occur inside a Mock definition, throw an exception and write to the log. We should halt execution, as we aren't sure the test suite accurately reflects the user's intent.

We want to take a similar approach throughout the code. It will mean "extra" checks and "extra" exceptions and logging, but it is more important to make the tool usable than to try and optimize for compute performance.

Clone this wiki locally