LTM:基于语言模型的可扩展黑盒相似性测试套件最小化方法
LTM: Scalable and Black-box Similarity-based Test Suite Minimization based on Language Models
AI总结:
本文提出LTM,一种基于大语言模型的黑盒相似性测试套件最小化方法,通过比较五种预训练模型的嵌入相似度并引导遗传算法搜索,在节省率、故障检测率和扩展性上优于现有方法。
摘要:
随着软件演化,测试套件往往会不断增长,使得在分配的测试预算内执行所有测试用例往往不可行,尤其是对于大型软件系统而言。测试套件最小化(TSM)通过移除冗余测试用例来提高软件测试效率,从而减少测试时间和资源,同时保持测试套件的故障检测能力。现有的大多数TSM方法依赖于代码覆盖率(白盒)或基于模型的特征,而这些特征对测试工程师来说并不总是可用的。最近,仅依赖测试代码(黑盒)的TSM方法已被提出,例如ATM和FAST-R。为了解决可扩展性问题,我们提出了LTM(基于语言模型的测试套件最小化),这是一种新颖的、可扩展的、基于大语言模型(LLMs)的黑盒相似性TSM方法,也是LLMs在TSM场景中的首次应用。为了支持测试代码嵌入的相似性度量,我们研究了五种预训练语言模型:CodeBERT、GraphCodeBERT、UniXcoder、StarEncoder和CodeLlama,并在这些模型上计算两种相似性度量:余弦相似度和欧氏距离。我们的目标是找到不仅在计算上更高效,而且能更好地引导遗传算法(GA)搜索最优最小化测试套件的相似性度量,从而减少整体搜索时间。实验结果表明,LTM的最佳配置(UniXcoder/余弦相似度)在三个方面优于ATM:(a)实现了略高的测试时间节省率(平均41.72%对41.02%);(b)获得了显著更高的故障检测率(平均0.84对0.81);最重要的是,(c)平均最小化测试套件的速度提高了近五倍,并且对于更大的测试套件和系统收益更高,从而实现了显著更高的可扩展性。
英文摘要:
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. To address the scalability, we propose LTM (Language model-based Test suite Minimization), 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 for test code embeddings, we investigate five 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) 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 (41.72% versus 41.02%, on average); (b) attaining a significantly higher fault detection rate (0.84 versus 0.81, 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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。