Leveraging Large Language Models (LLM) like GPT-4 in the auto-generation of code represents a significant advancement, yet it is not without its challenges. The ambiguity inherent in natural language descriptions of software poses substantial obstacles to generating deployable, structured artifacts. This research champions Model-Driven Development (MDD) as a viable strategy to overcome these challenges, proposing an Agile Model-Driven Development (AMDD) approach that employs GPT-4 as a code generator. This approach enhances the flexibility and scalability of the code auto-generation process and offers agility that allows seamless adaptation to changes in models or deployment environments. We illustrate this by modeling a multi-agent Unmanned Vehicle Fleet (UVF) system using the Unified Modeling Language (UML), significantly reducing model ambiguity by integrating the Object Constraint Language (OCL) for code structure meta-modeling, and the FIPA ontology language for communication semantics meta-modeling. Applying GPT-4’s auto-generation capabilities yields Java and Python code that is compatible with the JADE and PADE frameworks, respectively. Our thorough evaluation of the auto-generated code verifies its alignment with expected behaviors and identifies enhancements in agent interactions. Structurally, we assessed the complexity of code derived from a model constrained solely by OCL meta-models, against that influenced by both OCL and FIPA-ontology meta-models. The results indicate that the ontology-constrained meta-model produces inherently more complex code, yet its cyclomatic complexity remains within manageable levels, suggesting that additional meta-model constraints can be incorporated without exceeding the high-risk threshold for complexity.

错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

LLM as a Code Generator in Agile Model Driven Development

  • Ahmed R. Sadik,
  • Sebastian Brulin,
  • Markus Olhofer,
  • Antonello Ceravola,
  • Frank Joublin

摘要

Leveraging Large Language Models (LLM) like GPT-4 in the auto-generation of code represents a significant advancement, yet it is not without its challenges. The ambiguity inherent in natural language descriptions of software poses substantial obstacles to generating deployable, structured artifacts. This research champions Model-Driven Development (MDD) as a viable strategy to overcome these challenges, proposing an Agile Model-Driven Development (AMDD) approach that employs GPT-4 as a code generator. This approach enhances the flexibility and scalability of the code auto-generation process and offers agility that allows seamless adaptation to changes in models or deployment environments. We illustrate this by modeling a multi-agent Unmanned Vehicle Fleet (UVF) system using the Unified Modeling Language (UML), significantly reducing model ambiguity by integrating the Object Constraint Language (OCL) for code structure meta-modeling, and the FIPA ontology language for communication semantics meta-modeling. Applying GPT-4’s auto-generation capabilities yields Java and Python code that is compatible with the JADE and PADE frameworks, respectively. Our thorough evaluation of the auto-generated code verifies its alignment with expected behaviors and identifies enhancements in agent interactions. Structurally, we assessed the complexity of code derived from a model constrained solely by OCL meta-models, against that influenced by both OCL and FIPA-ontology meta-models. The results indicate that the ontology-constrained meta-model produces inherently more complex code, yet its cyclomatic complexity remains within manageable levels, suggesting that additional meta-model constraints can be incorporated without exceeding the high-risk threshold for complexity.