Toward Generating Microservice Architectures from Textual Requirements with Large Language Models
Large Language Models (LLMs) have demonstrated strong performance in natural language understanding and generation, opening new possibilities for automating software engineering tasks. This study evaluates whether the GPT-4 O3 model can generate microservice-oriented architectures directly from textual requirements. We applied two prompting strategies—zero-shot (ZS) and few-shot (FS)—to two real-world-inspired systems (Bookstore and PetClinic) and compared the outputs against their reference architectures. In ZS, GPT-4 identified 11 out of 14 expected services (precision, recall, and F1 ≈ 0.79) and recovered 33 out of 38 interservice links (precision ≈ 0.50, recall ≈ 0.87, F1 ≈ 0.64), but also introduced 34 unsupported links. Under FS, it matched all 14 services (precision ≈ 0.93, recall = 1.00, F1 ≈ 0.97) and recovered every expected link, while reducing spurious connections to 12 (precision ≈ 0.76, recall = 1.00, F1 ≈ 0.86). A mixed-methods evaluation by four senior architects confirmed these trends. The FS received the best expert scores (avg. correctness ≈ 4.6/5, plausibility ≈ 4.5/5) because they balanced full requirement coverage with sound modularity, whereas the ZS versions, though complete, were downgraded for dense bidirectional coupling (plausibility ≈ 2/5). The reference architecture sat in between, structurally tidy but functionally sparse. Overall, the study shows that supplying even a single exemplar can transform GPT-4 from a rough sketch generator into a credible assistant for microservice decomposition, giving architects a rapid and reliable starting point for design.
Authors
- Ângelo Perkusich (ORCID: https://orcid.org/0000-0002-7377-1258)
- Kyller Gorgônio (ORCID: https://orcid.org/0000-0001-9796-1382)
- Guillermo Rodríguez (ORCID: https://orcid.org/0000-0003-4125-3998)
- J. Andrés Díaz‐Pace (ORCID: https://orcid.org/0000-0002-1765-7872)
- Danyllo Albuquerque
- J. R. Pereira (ORCID: https://orcid.org/0000-0002-2110-6790)
Publication Details
- Published
- 2025-09-19
- DOI
- https://doi.org/10.5753/sbcars.2025.14591
- Citations
- 1
- Primary Topic
- Software System Performance and Reliability
- Type
- article
- Field-Weighted Citation Impact
- 1.49