Toward Generating Microservice Architectures from Textual Requirements with Large Language Models

  • Jose Renan A. Pereira UFCG
  • Danyllo Albuquerque UFCG
  • Mirko Perkusich UFCG
  • Guillermo Rodríguez ISISTAN / UNICEN
  • Jorge Andrés Díaz-Pace ISISTAN / UNICEN
  • Kyller Gorgônio UFCG
  • Angelo Perkusich UFCG

Abstract


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.

Keywords: Software Architecture, LLM, Software Modernization, Microservices, Architectural Decomposition

References

Yalemisew Abgaz, Andrew McCarren, Peter Elger, David Solan, Neil Lapuz, Marin Bivol, Glenn Jackson, Murat Yilmaz, Jim Buckley, and Paul Clarke. 2023. Decomposition of monolith applications into microservices architectures: A systematic review. IEEE Transactions on Software Engineering 49, 8 (2023), 4213–4242.

Danyllo Albuquerque. 2025. [SBCARS - CBSoft 2025] Toward Generating Microservice Architectures from Textual Requirements with Large Language Models. (8 2025). DOI: 10.6084/m9.figshare.29974345.v4

Danyllo Albuquerque, Everton Guimarães, Graziela Tonin, Pilar Rodríguezs, Mirko Perkusich, Hyggo Almeida, Angelo Perkusich, and Ferdinandy Chagas. 2022. Managing technical debt using intelligent techniques-a systematic mapping study. IEEE Transactions on Software Engineering 49, 4 (2022), 2202–2220.

Khaled Alsayed and Omar Benomar. 2024. MicroDec: Hybrid Static + LLM Embeddings for Microservice Extraction. Journal of Systems and Software 203 (2024), 111622.

Wesley KG Assunção, Luciano Marchezan, Lawrence Arkoh, Alexander Egyed, and Rudolf Ramler. [n. d.]. Contemporary Software Modernization: Strategies, Driving Forces, and Research Opportunities. ACM Transactions on Software Engineering and Methodology ( [n. d.]).

Mohammadmehdi Ataei, Hyunmin Cheong, Daniele Grandi, Ye Wang, Nigel Morris, and Alexander Tessier. 2025. Elicitron: A Large Language Model Agent-Based Simulation Framework for Design Requirements Elicitation. Journal of Computing and Information Science in Engineering 25, 2 (2025).

Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. 2020. Language models are few-shot learners. Advances in neural information processing systems 33 (2020), 1877–1901.

Vincent Bushong, Amr S Abdelfattah, Abdullah A Maruf, Dipta Das, Austin Lehman, Eric Jaroszewski, Michael Coffey, Tomas Cerny, Karel Frajtak, Pavel Tisnovsky, et al. 2021. On microservice analysis and architecture evolution: A systematic mapping study. Applied Sciences 11, 17 (2021), 7856.

Rafael Capilla, Anton Jansen, Antony Tang, Paris Avgeriou, and Muhammad Ali Babar. 2016. 10 years of software architecture knowledge management: Practice and future. Journal of Systems and Software 116 (2016), 191–205.

Rudra Dhar, Karthik Vaidhyanathan, and Vasudeva Varma. 2024. Can llms generate architectural design decisions?-an exploratory empirical study. In 2024 IEEE 21st International Conference on Software Architecture (ICSA). IEEE, 79–89.

Jonas Fritzsch, Justus Bogner, Alfred Zimmermann, and Stefan Wagner. 2018. From monolith to microservices: A classification of refactoring approaches. In International Workshop on Software Engineering Aspects of Continuous Development and New Paradigms of Software Production and Deployment. Springer, 128–141.

Matthias Gysel, Lukas Kölbener, Peter Gantenbein, and Olaf Zimmermann. 2016. Service cutter: A systematic approach to service decomposition. In European Conference on Service-Oriented and Cloud Computing. Springer, 185–200.

Hossam Hassan, Manal A Abdel-Fattah, and Wael Mohamed. 2024. Migrating from Monolithic to Microservice Architectures: A Systematic Literature Review. International Journal of Advanced Computer Science & Applications 15, 10.

Junda He, Christoph Treude, and David Lo. 2024. LLM-Based Multi-Agent Systems for Software Engineering: Literature Review, Vision and the Road Ahead. ACM Transactions on Software Engineering and Methodology.

Xinyi Hou, Yanjie Zhao, Yue Liu, Zhou Yang, Kailong Wang, Li Li, Xiapu Luo, David Lo, John Grundy, and Haoyu Wang. 2024. Large language models for software engineering: A systematic literature review. ACM Transactions on Software Engineering and Methodology 33, 8 (2024), 1–79.

Mohammad Imranur, Sebastiano Panichella, Davide Taibi, et al. 2019. A curated dataset of microservices-based systems. arXiv preprint arXiv:1909.03249 (2019).

Jasmin Jahić and Ashkan Sami. 2024. State of Practice: LLMs in Software Engineering and Software Architecture. In 2024 IEEE 21st International Conference on Software Architecture Companion (ICSA-C). IEEE, 311–318.

Haolin Jin, Linghan Huang, Haipeng Cai, Jun Yan, Bo Li, and Huaming Chen. 2024. From llms to llm-based agents for software engineering: A survey of current, challenges and future. arXiv preprint arXiv:2408.02479 (2024).

Munezero Immaculee Joselyne, Gaurav Bajpai, and Frederic Nzanywayingoma. 2021. A systematic framework of application modernization to microservice based architecture. In 2021 International Conference on Engineering and Emerging Technologies (ICEET). IEEE, 1–6.

Martin Kaloudis. 2024. Evolving Software Architectures from Monolithic Systems to Resilient Microservices: Best Practices, Challenges and Future Trends. International Journal of Advanced Computer Science & Applications 15, 9 (2024).

Goran Mazlami, Johannes Cito, and Philipp Leitner. 2017. Extraction of microservices from monolithic software architectures. In 2017 IEEE International Conference on Web Services (ICWS). IEEE, 524–531.

Vinicius L Nogueira, Fernando S Felizardo, Aline MMM Amaral, Wesley KG Assunção, and Thelma E Colanzi. 2024. Insights on Microservice Architecture Through the Eyes of Industry Practitioners. In 2024 IEEE International Conference on Software Maintenance and Evolution (ICSME). IEEE, 765–777.

Idris Oumoussa and Rajaa Saidi. 2024. Evolution of microservices identification in monolith decomposition: A systematic review. IEEE Access 12 (2024), 23389–23405.

Mirko Perkusich, Lenardo Chaves e Silva, Alexandre Costa, Felipe Ramos, Renata Saraiva, Arthur Freire, Ednaldo Dilorenzo, Emanuel Dantas, Danilo Santos, Kyller Gorgônio, et al. 2020. Intelligent software engineering in the context of agile software development: A systematic literature review. Information and Software Technology 119 (2020), 106241.

Yamina Romani, Okba Tibermacine, and Chouki Tibermacine. 2022. Towards migrating legacy software systems to microservice-based architectures: a datacentric process for microservice identification. In 2022 IEEE 19th International Conference on Software Architecture Companion (ICSA-C). IEEE, 15–19.

Ana Martínez Saucedo, J Andres Diaz-Pace, Hernán Astudillo, and Guillermo Rodríguez. 2024. On the Variability of Microservice Decompositions: A Data-Driven Analysis. In 2024 L Latin American Computer Conference (CLEI). IEEE, 1–9.

Ana Martínez Saucedo, Guillermo Rodríguez, Fabio Gomes Rocha, and Rodrigo Pereira dos Santos. 2025. Migration of monolithic systems to microservices: A systematic mapping study. Information and Software Technology 177 (2025), 107590.

Robert C Seacord, Daniel Plakosh, and Grace A Lewis. 2003. Modernizing legacy systems: software technologies, engineering processes, and business practices. Addison-Wesley Professional.

Khaled Sellami and Mohamed Aymen Saied. 2025. Contrastive Learning-Enhanced Large Language Models for Monolith-to-Microservice Decomposition. arXiv preprint arXiv:2502.04604 (2025).

Claes Wohlin, Per Runeson, Martin Höst, Magnus C Ohlsson, Björn Regnell, Anders Wesslén, et al. 2012. Experimentation in software engineering. Vol. 236. Springer.

EberhardWolff. 2016. Microservices: flexible software architecture. Addison-Wesley Professional.

Zibin Zheng, Kaiwen Ning, Qingyuan Zhong, Jiachi Chen, Wenqing Chen, Lianghong Guo, Weicheng Wang, and Yanlin Wang. 2025. Towards an understanding of large language models in software engineering tasks. Empirical Software Engineering 30, 2 (2025), 50.
Published
2025-09-22
PEREIRA, Jose Renan A.; ALBUQUERQUE, Danyllo; PERKUSICH, Mirko; RODRÍGUEZ, Guillermo; DÍAZ-PACE, Jorge Andrés; GORGÔNIO, Kyller; PERKUSICH, Angelo. Toward Generating Microservice Architectures from Textual Requirements with Large Language Models. In: BRAZILIAN SYMPOSIUM ON SOFTWARE COMPONENTS, ARCHITECTURES, AND REUSE (SBCARS), 19. , 2025, Recife/PE. Anais [...]. Porto Alegre: Sociedade Brasileira de Computação, 2025 . p. 79-89. DOI: https://doi.org/10.5753/sbcars.2025.14591.