LLM as a code generator in Agile Model Driven Development

๐Ÿ“… 2024-10-24
๐Ÿ›๏ธ arXiv.org
๐Ÿ“ˆ Citations: 0
โœจ Influential: 0
๐Ÿ“„ PDF
๐Ÿค– AI Summary
Ambiguity in natural-language specifications severely hinders the automated generation of deployable agent code. This paper proposes an OCL+FIPA dual-semantic-constraint-driven LLM-enhanced modeling method: within the AMDD framework, we model a UAV swarm system using UML; enforce structural and behavioral constraints via Object Constraint Language (OCL); and precisely define agent communication semantics using the FIPA ontology. Leveraging GPT-4, we generate executable code compatible with both JADE (Java) and PADE (Python) agent platforms. To our knowledge, this is the first approach to jointly embed OCL metamodeling and FIPA semantic ontologies into the LLM code-generation pipelineโ€”thereby ensuring formal rigor without sacrificing development agility. Experimental evaluation demonstrates 100% behavioral verification pass rate for generated code, with cyclomatic complexity strictly maintained below low-risk thresholds. The method significantly improves interaction robustness and cross-agent behavioral consistency.

Technology Category

Application Category

๐Ÿ“ Abstract
Leveraging Large Language Models (LLM) like GPT4 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 GPT4 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 GPT4 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.
Problem

Research questions and friction points this paper is trying to address.

Address ambiguity in natural language descriptions for code generation
Enhance flexibility and scalability in Agile Model Driven Development
Evaluate complexity of auto-generated code with meta model constraints
Innovation

Methods, ideas, or system contributions that make the work stand out.

Agile Model Driven Development with GPT4
UML and OCL for reducing model ambiguity
FIPA ontology for communication semantics
๐Ÿ”Ž Similar Papers
No similar papers found.
Ahmed R. Sadik
Ahmed R. Sadik
Honda Research Institute - EU
Sebastian Brulin
Sebastian Brulin
Honda Research Institute Europe, Carl-Legien-Strasse 30, Offenbach am Main, Germany
M
Markus Olhofer
Honda Research Institute Europe, Carl-Legien-Strasse 30, Offenbach am Main, Germany
Antonello Ceravola
Antonello Ceravola
Honda Research Institute Europe, Carl-Legien-Strasse 30, Offenbach am Main, Germany
F
F. Joublin
Honda Research Institute Europe, Carl-Legien-Strasse 30, Offenbach am Main, Germany