LTM: Scalable and Black-Box Similarity-Based Test Suite Minimization Based on Language Models

Test suites tend to grow when software evolves, making it often infeasible to execute all test cases with the allocated testing budgets, especially for large software systems. Test suite minimization (TSM) is employed to improve the efficiency of software testing by removing redundant test cases, th...

Full description

Saved in:
Bibliographic Details
Published in:IEEE transactions on software engineering Vol. 50; no. 11; pp. 3053 - 3070
Main Authors: Pan, Rongqi, Ghaleb, Taher A., Briand, Lionel C.
Format: Journal Article
Language:English
Published: New York IEEE 01-11-2024
IEEE Computer Society
Subjects:
Online Access:Get full text
Tags: Add Tag
No Tags, Be the first to tag this record!
Description
Summary:Test suites tend to grow when software evolves, making it often infeasible to execute all test cases with the allocated testing budgets, especially for large software systems. Test suite minimization (TSM) is employed to improve the efficiency of software testing by removing redundant test cases, thus reducing testing time and resources while maintaining the fault detection capability of the test suite. Most existing TSM approaches rely on code coverage (white-box) or model-based features, which are not always available to test engineers. Recent TSM approaches that rely only on test code (black-box) have been proposed, such as ATM and FAST-R. The former yields higher fault detection rates ( FDR ) while the latter is faster. To address scalability while retaining a high FDR , we propose LTM ( L anguage model-based T est suite M inimization), a novel, scalable, and black-box similarity-based TSM approach based on large language models (LLMs), which is the first application of LLMs in the context of TSM. To support similarity measurement using test method embeddings, we investigate five different pre-trained language models: CodeBERT, GraphCodeBERT, UniXcoder, StarEncoder, and CodeLlama, on which we compute two similarity measures: Cosine Similarity and Euclidean Distance. Our goal is to find similarity measures that are not only computationally more efficient but can also better guide a Genetic Algorithm (GA), which is used to search for optimal minimized test suites, thus reducing the overall search time. Experimental results show that the best configuration of LTM (UniXcoder/Cosine) outperforms ATM in three aspects: (a) achieving a slightly greater saving rate of testing time (<inline-formula><tex-math notation="LaTeX">41.72\%</tex-math> <mml:math display="inline"><mml:mn>41.72</mml:mn><mml:mi mathvariant="normal">%</mml:mi></mml:math><inline-graphic xlink:href="pan-ieq1-3469582.gif"/> </inline-formula> versus <inline-formula><tex-math notation="LaTeX">41.02\%</tex-math> <mml:math display="inline"><mml:mn>41.02</mml:mn><mml:mi mathvariant="normal">%</mml:mi></mml:math><inline-graphic xlink:href="pan-ieq2-3469582.gif"/> </inline-formula>, on average); (b) attaining a significantly higher fault detection rate (<inline-formula><tex-math notation="LaTeX">0.84</tex-math> <mml:math display="inline"><mml:mn>0.84</mml:mn></mml:math><inline-graphic xlink:href="pan-ieq3-3469582.gif"/> </inline-formula> versus <inline-formula><tex-math notation="LaTeX">0.81</tex-math> <mml:math display="inline"><mml:mn>0.81</mml:mn></mml:math><inline-graphic xlink:href="pan-ieq4-3469582.gif"/> </inline-formula>, on average); and, most importantly, (c) minimizing test suites nearly five times faster on average, with higher gains for larger test suites and systems, thus achieving much higher scalability.
ISSN:0098-5589
1939-3520
DOI:10.1109/TSE.2024.3469582