Beyond Code Generation: A Spec-Driven Experience Report on LLM-Assisted Modernization of a Legacy Delphi System
Resumo
Legacy software modernization remains a major challenge for organizations that rely on obsolete technologies, limited documentation, and business rules embedded in source code. Although Large Language Models (LLMs) have significantly expanded the possibilities for code generation, there is still limited evidence of their use in the modernization of real-world legacy systems. This paper presents an ongoing experience report on the migration of a pet shop and veterinary clinic management system from Delphi/Firebird to a web architecture based on Java/Spring Boot, Angular, and MySQL, supported by the Codex coding agent. Unlike approaches based on direct code translation, the adopted process follows a spec-driven strategy in which specifications are reconstructed from the legacy system, reviewed by developers, and used as the primary artifact for AI-assisted implementation. So far, the approach has been applied to 41 screens and functional modules, as well as two production database migrations. The paper describes the adopted workflow, discusses key architectural decisions, and presents lessons learned.
Referências
Andréa Bordin and Luiza Garcia. 2024. An Industry View about Legacy Systems. In Anais do XII Workshop de Visualização, Evolução e Manutenção de Software (Curitiba/PR). SBC, Porto Alegre, RS, Brasil, 137–148. DOI: 10.5753/vem.2024.3914
Keyuan Cheng, Xudong Shen, Yihao Yang, Tengyue Wang, Yang Cao, Muhammad Asif Ali, Hanbin Wang, Lijie Hu, and Di Wang. 2025. CODEMENV: Benchmarking Large LanguageModels on CodeMigration. In Findings of the Association for Computational Linguistics: ACL 2025, Wanxiang Che, Joyce Nabende, Ekaterina Shutova, and Mohammad Taher Pilehvar (Eds.). Association for Computational Linguistics, Vienna, Austria, 2719–2744. DOI: 10.18653/v1/2025.findings-acl.140
Sanderson Oliveira de Macedo and Ronaldo Martins da Costa. 2026. Reversa: A Reverse Documentation Engineering Framework for Converting Legacy Software into Operational Specifications for AI Agents. arXiv:2605.18684 [cs.SE] [link]
Wellynton Diniz, Marcela Valença, César França, Alessandro Santos, and Mariana Pincovsky. 2024. The Skill Gap in Software Industry: A Mapping Study. In Anais do XXXVIII Simpósio Brasileiro de Engenharia de Software (Curitiba/PR). SBC, Porto Alegre, RS, Brasil, 192–200. DOI: 10.5753/sbes.2024.3351
Giovanna Fernandes, Marcelo Maia, and Carlos Dantas. 2025. How Readable Is LLM-Generated Code Snippets? A Comparison of ChatGPT, DeepSeek, and Gemini. In Anais do XIII Workshop de Visualização, Evolução e Manutenção de Software (Recife/PE). SBC, Porto Alegre, RS, Brasil, 13–24. DOI: 10.5753/vem.2025.14275
Mohayeminul Islam, Ajay Kumar Jha, May Mahmoud, Ildar Akhmetov, and Sarah Nadi. 2025. An Empirical Study of Python Library Migration Using Large Language Models. In 2025 40th IEEE/ACM International Conference on Automated Software Engineering (ASE) (Seoul, Korea, Republic of). IEEE Press, 867–879. DOI: 10.1109/ASE63991.2025.00077
Suman Jain and Inderveer Chana. 2015. Modernization of Legacy Systems: A Generalised Roadmap. In Proceedings of the Sixth International Conference on Computer and Communication Technology 2015 (Allahabad, India) (ICCCT ’15). Association for Computing Machinery, New York, NY, USA, 62–67. DOI: 10.1145/2818567.2818579
Ravi Khadka, Belfrit V. Batlajery, Amir M. Saeidi, Slinger Jansen, and Jurriaan Hage. 2014. How do professionals perceive legacy systems and software modernization?. In Proceedings of the 36th International Conference on Software Engineering (Hyderabad, India) (ICSE 2014). Association for Computing Machinery, New York, NY, USA, 36–47. DOI: 10.1145/2568225.2568318
Rangeet Pan, Ali Reza Ibrahimzada, Rahul Krishna, Divya Sankar, Lambert Pouguem Wassi, Michele Merler, Boris Sobolev, Raju Pavuluri, Saurabh Sinha, and Reyhaneh Jabbarvand. 2024. Lost in Translation: A Study of Bugs Introduced by Large Language Models while Translating Code. In Proceedings of the IEEE/ACM 46th International Conference on Software Engineering (Lisbon, Portugal) (ICSE ’24). Association for Computing Machinery, New York, NY, USA, Article 82, 13 pages. DOI: 10.1145/3597503.3639226
Vinicius Pimenta, Elder Cirilo, and Ricardo Terra. 2024. Troca de Bibliotecas em Sistemas com e sem Arquitetura Limpa: Uma Análise de Esforço. In Anais do XII Workshop de Visualização, Evolução e Manutenção de Software (Curitiba/PR). SBC, Porto Alegre, RS, Brasil, 23–34. DOI: 10.5753/vem.2024.3829
Deepak Babu Piskala. 2026. Spec-Driven Development:From Code to Contract in the Age of AI Coding Assistants. arXiv:2602.00180 [cs.SE] [link]
Edson Silva, Rodolfo Rodrigues, Johnatan Oliveira, Danilo Boechat, and Cleiton Tavares. 2024. Evaluating Test Quality in GitHub Repositories: A Comparative Analysis of CI/CD Practices Using GitHub Actions. In Anais do XII Workshop de Visualização, Evolução e Manutenção de Software (Curitiba/PR). SBC, Porto Alegre, RS, Brasil, 45–55. DOI: 10.5753/vem.2024.3842
Julyanara Silva, Carlos Dantas, and Marcelo Maia. 2024. What Developers Ask to ChatGPT in GitHub Pull Requests? an Exploratory Study. In Anais do XII Workshop de Visualização, Evolução e Manutenção de Software (Curitiba/PR). SBC, Porto Alegre, RS, Brasil, 125–136. DOI: 10.5753/vem.2024.3913
