Software testing is one of the most expensive and critical activities in the entire software development lifecycle and significantly impacts development costs, as more than half of all defects are detected only in later stages. The advent of Large Language Models (LLMs) has opened new perspectives for the partial or full automation of complex tasks, such as unit test generation and Automated Program Repair (APR). However, the industrial adoption of LLMs is limited by issues such as code hallucinations, semantically incorrect tests, privacy constraints, and API costs. The objective of this work is to conduct a Systematic Literature Review (SLR), following the Kitchenham and Charters guidelines for software engineering and the PRISMA 2020 statement. The review addresses four research questions concerning: the adopted models and interaction techniques (RQ1), the supported testing activities (RQ2), the benefits and effectiveness evaluation metrics (RQ3), and the technical limitations and open challenges (RQ4). Out of 300 screened records, 73 studies were integrated and, following a final filter for recency and relevance, 40 studies published between 2023 and 2026 were analyzed. Test generation is the most represented area, where prompting is the most widespread technique (often combined with execution feedback). Studies report improvements in coverage, test correctness, detected defects, and repairs, though results depend on the benchmarks and are not directly comparable. The most recurring limitations reported by the authors are training data contamination and the external validity of results, alongside errors and hallucinations in generated tests and model dependency. This thesis thus provides an overview of the main tools, benefits, and future research directions.
Il software testing è una delle attività più onerose e critiche dell’intero ciclo di vita del software e incide in modo rilevante sui costi di sviluppo in quanto oltre la metà dei difetti viene individuata soltanto nelle fasi successive. L’avvento dei Large Language Model (LLM) ha aperto nuove prospettive per l’automazione parziale o totale di attività complesse, quali la generazione di unit test e la riparazione automatica dei difetti (Automated Program Repair, APR). L’adozione industriale degli LLM è tuttavia limitata da problemi quali allucinazioni nel codice, test semanticamente errati, vincoli di privacy e costi delle API. L’obiettivo di questo lavoro è condurre una revisione sistematica della letteratura (Systematic Literature Review, SLR), con riferimento alle linee guida di Kitchenham e Charters per l’ingegneria del software e alla dichiarazione PRISMA 2020. La rassegna risponde a quattro domande di ricerca riguardanti: i modelli e le tecniche di interazione adottati (RQ1), le attività di testing supportate (RQ2), i benefici e le metriche di valutazione dell’efficacia (RQ3), i limiti tecnici e le sfide aperte (RQ4). Dei 300 record esaminati sono stati integrati 73 studi e, con un filtro finale di attualità e rilevanza, ne sono stati analizzati 40, pubblicati tra il 2023 e il 2026. La generazione di test è l’ambito più rappresentato, nel quale il prompting è la tecnica più diffusa (spesso combinato con la retroazione dall’esecuzione). Gli studi riportano miglioramenti in copertura, correttezza dei test, difetti individuati e riparazioni, ma i risultati dipendono dai benchmark e non sono confrontabili. I limiti più ricorrenti dichiarati dagli autori sono la contaminazione dei dati di addestramento e la validità esterna dei risultati, a cui si aggiungono errori e allucinazioni nei test generati e la dipendenza dal modello. L’elaborato offre così un quadro dei principali strumenti, dei benefici e delle direzioni di ricerca future.
ANALISI SULL’UTILIZZO DEI LARGE LANGUAGE MODEL NEL SOFTWARE TESTING
GENTILE, LUCA
2025/2026
Abstract
Software testing is one of the most expensive and critical activities in the entire software development lifecycle and significantly impacts development costs, as more than half of all defects are detected only in later stages. The advent of Large Language Models (LLMs) has opened new perspectives for the partial or full automation of complex tasks, such as unit test generation and Automated Program Repair (APR). However, the industrial adoption of LLMs is limited by issues such as code hallucinations, semantically incorrect tests, privacy constraints, and API costs. The objective of this work is to conduct a Systematic Literature Review (SLR), following the Kitchenham and Charters guidelines for software engineering and the PRISMA 2020 statement. The review addresses four research questions concerning: the adopted models and interaction techniques (RQ1), the supported testing activities (RQ2), the benefits and effectiveness evaluation metrics (RQ3), and the technical limitations and open challenges (RQ4). Out of 300 screened records, 73 studies were integrated and, following a final filter for recency and relevance, 40 studies published between 2023 and 2026 were analyzed. Test generation is the most represented area, where prompting is the most widespread technique (often combined with execution feedback). Studies report improvements in coverage, test correctness, detected defects, and repairs, though results depend on the benchmarks and are not directly comparable. The most recurring limitations reported by the authors are training data contamination and the external validity of results, alongside errors and hallucinations in generated tests and model dependency. This thesis thus provides an overview of the main tools, benefits, and future research directions.I documenti in UNITESI sono protetti da copyright e tutti i diritti sono riservati, salvo diversa indicazione.
https://hdl.handle.net/20.500.14253/111359