20. Debugging and Testing the OpenSCADA project
To monitor the quality of code and test the performance of various parts of the system the special modules are written that perform testing with the issue of testing protocol. These modules must be executed after the completion of any part of the project.
21. Rules for design and commenting of the sources of OpenSCADA and its modules
When writing and design of the sources of the OpenSCADA system and its modules you must to follow the rules:
- indent between the levels of enclosure: 4 characters;
- braces of opening and closing must be placed in separate lines at the level of the previous text;
- it is possible to write an enclosure in the single line with the previous level of enclosure, in case of increasing the readability of the code;;
- distance between the descriptions of the functions of at least one character;
- the distance between the definition of variables and the text of the program at least one symbol;
- it is possible to define variables in the text while saving the readability;
- to avoid long lines more than 100 characters;
- preprocessor commands must be located on the first level, regardless of the current level of the text;
- for the formatting the source code, inherited from the other free applications and examples, it is recommended to use the utility:
indent -bli0 -i4 -l100 -npsl -npcs -prs -nsaf -nsai -ts8 <filename>.
Commenting rules of the OpenSCADA sources:
- obligatory commenting and thorough description is necessary for class declarations;
- declarations of public methods of the class should be thoroughly described with the individual description of each parameter;
- declarations of public attributes should also be thoroughly commented;
- text functions do not need to be thoroughly commented, but the implicit places are to be commented.
22. Ñonventional signs in the text and source code
???? — doubt in the usefulness of this section;
?!?! — the section is not fully implemented;
!!!! — the section requires a rethinking.