Automated Test Code Generation from Textual Descriptions Using Generative AI
2024 (English)Independent thesis Advanced level (degree of Master (Two Years)), 20 credits / 30 HE credits
Student thesis
Abstract [en]
Background: The growing complexity of software systems has heightened interest in automating various development tasks, with converting textual descriptions into structured code being one such area. Large language models (LLMs) show great promise in automating this process, yet their use in generating XML-based Java Spring Beans configurations remains under explored. This study examines how LLMs can be utilized to enhance code generation.
Problem Statement: The increasing use of LLMs in software development highlights the need for automation in test configuration code generation. Despite advancements in AI, converting textual test case descriptions into XML-based Java Spring Beans configurations remains a challenge. The problem this study addresses is the lack of understanding of how to effectively leverage LLMs to automate this conversion, ensuring accurate, structured code with proper syntax and naming conventions.
Objectives: The project aims to explore how textual test case descriptions can be efficiently transformed into test configuration code using LLMs. It involves analyzing the depth and parameterization needed for generating optimized code and identifying the most suitable LLMs for this task. The project builds and evaluates a trained LLM instance that converts test case descriptions into test configuration code, specifically XML-based Java Spring Beans configurations, demonstrating the practical effectiveness of this approach in automating test configuration code generation.
Methods: This research uses experimentation and a Systematic Literature Review (SLR) to evaluate selected LLMs on datasets with varying levels of detail in test descriptions. It explores different training strategies to optimize model performance, particularly in handling varying input sequence lengths.
Results: The findings indicate that Mistral-7B is the best-performing model among those selected through the SLR. Phi-3-3.8B shows better code generation capabilities compared to CodeLlama-7B under the selected training strategies. The results also demonstrate that the level of detail in test case descriptions significantly improves the accuracy and quality of the generated XML-based Java Spring Beans configurations.
Conclusions: The study concludes that LLMs, particularly Mistral-7B, hold significant potential for automating the generation of XML-based Java Spring Beans configurations from textual descriptions. However, further research is required to explore optimal models, training strategies, and parameters to enhance performance and efficiency.
Place, publisher, year, edition, pages
2024. , p. 59
Keywords [en]
Generative AI, Large Language Models, Automated Code generation, Fine-tuning, PEFT-QLoRA
National Category
Computer and Information Sciences
Identifiers
URN: urn:nbn:se:bth-27148OAI: oai:DiVA.org:bth-27148DiVA, id: diva2:1915616
External cooperation
Ericsson, Lund
Subject / course
DV2572 Master´s Thesis in Computer Science
Educational program
DVADA Master Qualification Plan in Computer Science
Presentation
(English)
Supervisors
Examiners
2024-12-022024-11-242025-09-30Bibliographically approved