Test Case Migration from Monolith to Microservices Using Large Language Models

Hang-Wei Yeh, Shang‐Pin Ma, Yi Chen · 2024

Due to microservices' modularity, high scalability, and good fault tolerance, more and more software systems are transitioning from monolithic architectures to microservice architectures. In this migration process, the migration of test cases is a crucial step to ensure functional consistency and completeness before and after the migration, thereby maintaining the stability and reliability of the microservice system post-migration. However, despite numerous studies on architecture migration, there is still a lack of methods to efficiently convert test cases of monolithic systems into ones for the migrated microservices. Therefore, this study proposes a test migration approach based on Large Language Models (LLM), called LTM^3 (LLM-based Test Migration from Monolith to Microservices). During migration, LTM^3 identifies the correspondence between existing test cases and monolithic functions, the connections between monolithic functions and migrated microservices, and the dependencies between microservices. Subsequently, by utilizing LLM and appropriate prompting, the integration test cases of the monolithic system are transformed into contract test cases for each microservice. The experimental results showed that LTM^3 can effectively migrate most test cases, with only a tiny portion requiring manual adjustment.

Read the paper · More papers on PaperTik