From Textual Requirements to Microservice Architectures - A Comprehensive Evaluation of LLM-Based Design Synthesis

📄 arXiv: 2607.28307v1 📥 PDF

作者: Danyllo Albuquerque, José Renan, Guillermo Rodríguez, Guillermo Rodríguez, Emanuel Dantas, Ademar França, Mirko Perkusich, Kyller Gorgônio, Angelo Perkusich

分类: cs.SE, cs.AI

发布日期: 2026-07-30


💡 一句话要点

基于LLM的设计合成方法解决微服务架构识别问题

🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)

关键词: 微服务架构 大型语言模型 需求工程 架构设计 自动化生成

📋 核心要点

  1. 现有微服务架构识别方法主要依赖代码,难以在早期设计阶段有效应用,仅凭文本需求进行服务识别存在挑战。
  2. 论文提出利用大型语言模型(LLM)从文本需求生成微服务架构,探索需求工程与架构设计的结合。
  3. 实验结果显示,少样本提示下的服务识别F1分数达到0.97,专家评估认为少样本生成的架构在模块性和一致性上优于零样本生成的架构。

📝 摘要(中文)

微服务架构在现代化单体系统中占据主导地位,但识别合适的服务仍然具有挑战性且主要依赖人工。现有的分解方法主要以代码为中心,限制了在仅有文本需求的早期设计阶段的适用性。尽管大型语言模型(LLMs)取得了一定进展,但关于其从自然语言需求合成完整微服务架构的能力的实证证据仍然有限。本研究探讨了LLM是否能够在需求工程与架构设计之间架起桥梁,仅通过文本需求生成架构,并评估结构一致性和结果的感知质量。我们使用OpenAI o3进行混合方法研究,采用零样本和少样本提示,评估了两个系统的架构。结果表明,少样本提示下的服务识别一致性更高,专家评估也支持这一发现。

🔬 方法详解

问题定义:本研究旨在解决在仅有文本需求的情况下,如何有效识别和生成微服务架构的问题。现有方法过于依赖代码,限制了其在早期设计阶段的应用。

核心思路:本研究的核心思路是利用大型语言模型(LLM)从自然语言需求中自动生成微服务架构,旨在通过示例提示引导模型生成更高质量的架构设计。

技术框架:研究采用混合方法,使用OpenAI o3模型进行零样本和少样本提示,针对两个系统(书店和宠物诊所)进行架构生成与评估。主要模块包括需求解析、服务识别、通信恢复和专家评估。

关键创新:本研究的关键创新在于首次将LLM应用于微服务架构的自动生成,尤其是在需求驱动的设计合成方面,填补了需求工程与架构设计之间的空白。

关键设计:在实验中,采用了零样本和少样本提示策略,评估服务识别的精度、召回率和F1分数,少样本提示下的F1分数达到0.97,且在通信恢复方面通过优化提示减少了不支持的依赖。

🖼️ 关键图片

fig_0
fig_1
fig_2

📊 实验亮点

实验结果显示,在少样本提示下,OpenAI o3模型的服务识别F1分数达到0.97,相较于零样本的0.79有显著提升。同时,通信恢复的F1分数在少样本情况下也提高至0.82,专家评估认为少样本生成的架构在模块性和一致性上优于零样本输出。

🎯 应用场景

该研究的潜在应用领域包括软件工程、系统架构设计和需求分析等。通过自动化微服务架构的生成,可以显著提高开发效率,降低人工干预的需求,未来可能推动软件开发流程的智能化和自动化。

📄 摘要(原文)

Microservice architectures have become dominant for modernizing monolithic systems, yet identifying appropriate services remains challenging and largely manual. Existing decomposition approaches are predominantly code-centric, limiting applicability in early design stages where only textual requirements are available. Despite advances in Large Language Models (LLMs), limited empirical evidence exists on their ability to synthesize complete microservice architectures from natural-language requirements, including service definitions and inter-service interactions. This study investigates whether an LLM can bridge requirements engineering and architectural design, generating architectures solely from textual requirements and evaluating structural agreement and perceived quality of results. We conduct a mixed-method study using OpenAI o3 under zero-shot (ZS) and few-shot (FS) prompting across two systems (Bookstore, PetClinic), one execution per system/condition. Architectures are evaluated through (i) comparison with reference architectures using precision, recall, and F1-score for service identification and communication recovery, and (ii) a blinded expert assessment of correctness, completeness, modularity, and plausibility, plus open feedback synthesis. OpenAI o3 identifies services with higher agreement under FS prompting (F1 = 0.79 for ZS versus = 0.97 for FS). Communication recovery is more challenging: ZS produces dense architectures with high recall but low precision (F1 = 0.61), while FS improves agreement, reaching F1 = 0.82 and reducing unsupported dependencies. Expert evaluation corroborates these results, with FS architectures perceived as more modular, coherent, and plausible than ZS outputs. OpenAI o3 shows potential for requirements-driven synthesis when guided by exemplar prompting. Results are model- and context-specific from two small systems, not model-independent proof.