A Dual-Stage Framework for Behavior-Enhanced Automated Code Generation in Industrial-Scale Meta-Models
Industrial model-driven engineering often struggles to generate functionally complete code, especially dynamic behaviors, from large-scale Meta-models, typically yielding only static structures. This paper introduces the Static-Structure&Dynamic-Behavior Dual-Stage framework, a novel approach enhancing automated code generation through two key innovations. First, the Dual-Path Fusion stage constructs a semantically rich static code skeleton by integrating structural semantics from XMI with data constraints from XSD. Second, the dynamic behavior injection engine leverages model annotations and associations to inject operational capabilities into the static foundation. A language-independent Intermediate Code Model unifies semantic information, facilitating transformations via Query/View/Transformation-Relations and domain-specific languages. Validation using industrial Meta-models such as AUTOSAR and OPC UA demonstrates significant improvements in automation, code quality, and development efficiency. This work also discusses Large Language Model limitations for reliable Meta-model-based code generation and posits S<sup xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">2</sup>D<sup xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">2</sup>’s potential, particularly with Retrieval Augmented Generation, to improve their code synthesis fidelity. Key contributions include advanced model transformation, behavior-centric code enhancement, and a pathway for more dependable AI-assisted software development.
Authors
- Ling Fang (ORCID: https://orcid.org/0000-0003-2092-3681)
- Y. S. Gao
- T. Ma (ORCID: https://orcid.org/0009-0001-4979-6666)
- Feng Xu (ORCID: https://orcid.org/0000-0001-8925-977X)
- Shaotao Dai
Institutions
- University of Science and Technology of China (CN)
- Chinese Academy of Sciences (CN)
- Hefei Institutes of Physical Science (CN)
Publication Details
- Journal
- IEEE Access
- Published
- 2025-01-01
- DOI
- https://doi.org/10.1109/access.2025.3614174
- Primary Topic
- Model-Driven Software Engineering Techniques
- Type
- article
- Field-Weighted Citation Impact
- 0.00