Programmable logic controllers (PLCs) have traditionally been used on numerous machines for control of the various processing and manufacturing steps. Special, safe PLC programs are employed for the handling of safety-related processes in these cases. Although these control systems support safe programming by means of special function modules, comprehensive programs can rapidly become confusingly complex, particularly when created in the form of an instruction set (IS).
In response to an initiative by the Expert Committee Chemical Industry (FA CH), suitable metrics were to be defined in order to permit rapid static analysis of comprehensive PLC programs. A tool was to be developed for this purpose which is also able to determine quality criteria (see project BIA0077, "Quality metrics for safety-related software in machine guarding").
A comprehensive literature survey and analysis of PLC programs was intended to identify the criteria for structural metrics for PLC controls. The Halstead metrics were to be adapted in their application to safety-related control programs. The quality criteria were to be adapted to PLC programs with close reference to the results of BIA project 0077.
The entire tool was implemented with reference to the existing mEtRIKA tools for C and JAVA. The metrics and quality criteria were validated on actual programs used in industry.
The literature survey revealed that no tool currently exists for the quality assessment of software for programmable logic controllers. The project therefore began by examining the particular features of programmable logic controllers in order to permit proposals for the analysis of source code in instruction set logic. Of the 16 newly formulated metrics for PLC programs, a total of seven were used for their quality criteria. Together with five metrics also available for other languages, a complete system is thus available for the description of testability, readability, simplicity and self-descriptiveness. The identification and quantifiability of these quality criteria were redesigned from scratch. The new method can be transferred to the quality assurance of all high-level programming languages. Comprehensive graphic support of the software is generated automatically and is available in the form of an HTML file.
The tool was validated against three comprehensive PLC programs (two from industrial projects).
chemical industryType of hazard:
Softwareergonomie, SicherheitstechnikDescription, key words:
programmable logic controllers (PLCs), metrics, Halstead, McCabe, software, quality, processing and manufacturing machines, instruction set (IS)