Code and Test Generation for I4.0 State Machines with LLM-based Diagram Recognition

2025

Full text Open access: Green Metadata (CSL-JSON)
DOI 10.1109/wfcs63373.2025.11077624
Data confidence 70 medium
How this score is calculated

It is built from checkable properties of the record itself: whether the article has a DOI, how many independent sources confirmed its data, whether the required fields are filled in, and how recent the latest confirmation is. Disagreement between sources and a missing identifier lower it. A value of 80 or above means the record was published without further checking; 60 to 79 means it is published at reduced confidence, with a manual check advisable. A record verified by an editor by hand is never pushed below 90 by a recalculation. This scores our data about the article, not the article itself.

Abstract

In the context of Industry 4.0, the automatic code and test generation from state diagrams embedded in specifications is a critical challenge for software correctness. In this paper we present an approach that leverages Large Language Models (LLMs) for the recognition of state diagrams to generate code and unit tests automatically. We compare the performance of LLMs with traditional computer vision models, highlighting the advantages of LLMs in terms of generalization and simplicity of setup. The results on two prominent industrial communication protocols, PROFINET and OPC UA, demonstrate the applicability of the approach, achieving significant reductions in manual effort and improving the accuracy of code and test generation.