Svenska Not logged in: Log in | Register

2015-02-25:

Note: Text covers an earlier version.

Testrunning and Debugging

Updated: 2015-02-25

To develop and test a Result Module, you need a MeOS competition already containing results of the type you want to develop the module for, that is, if you write a result module for an individual classes, you need individual results to test it with, if you write it for a team class, you need team results of that type.
Hint
You can use the Punching Test service on the page Services to generate a test competition.
When you have written the source code for a rule, you click Save changes to compile the code. If you get an error, there is some syntax error in your code, which you need to correct. Ensure that each statement ends with a semicolon, and use the error message to locate the problem.

When the code is successfully saved and compiled, you can click Test Result Module to test run the code on all runners and teams with results. If everything works, you will see a table with output, status, time, points, and result score, for each runner and team.

If there was an error running the method, the string Error is shown. A typical cause is that the code tries to read a variable or symbol which is not defined, or that it uses an invalid index to access a vector symbol.

If you got no errors, and the output was as expected, everything is fine and you are ready to use the result module in a list. However, when running for the first time, the most likely outcome is that it does not work. Then you can select Debug on a line containing the problem. A new window opens, which shows all symbols as defined for the competitor or team, and also shows all variables that your methods define and their values. It also output runtime errors, if any.
Note
Be sure to test the result module carefully before using it for an important competition. Make sure that it handles incomplete teams, missing punches, failed control units, status codes other that StatusOK, etc gracefully.

To post a comment, you need to log in.