Complexity of Structured Text in IEC 61499 Function Blocks: A Survey - Sonnleithner, Lisa; Wiesmayr, Bianca; Gutierrez, Antonio Manuel; Rabiser, Rick; Zoitl, Alois (2023 IEEE 28th International Conference on Emerging Technologies and Factory Automation (ETFA), 2023)
The rising complexity of modern production systems raises the need for evaluating the code quality also in control software engineering. Complexity metrics can help identifying code that is difficult to maintain and may benefit from a refactoring. Although complexity metrics have already been adapted to the domain-specific languages (DSLs) used for cyber-physical production systems (CPPSs), literature on whether developers benefit from using these metrics is limited. Also, the complexity perception of code by the domain experts remains to be investigated. The perceived difficulty of comprehending a program can vary among developers and also between different implementation variants of the same functionality. We therefore asked industrial experts, who have experience in the respective DSLs, to rate the complexity of semantically equivalent implementations to find out which metric best represents their complexity perception and whether there are differences between implementation variants. The examples used in the study were inspired, in parts, by an open source library for IEC 61131-3. We found that the Cognitive Complexity metric is a useful representation of the software complexity in the domain, as it best matched the domain experts' perception of complexity. These metrics should therefore be supported by the analysis tools.