ATM:基于测试代码相似度和进化搜索的黑盒测试用例最小化
ATM: Black-box Test Case Minimization based on Test Code Similarity and Evolutionary Search
摘要:
执行大型测试套件是耗时和资源消耗的,有时甚至是不可能的,并且这样的测试套件通常包含许多冗余的测试用例。因此,测试用例最小化被用来删除不太可能检测到新故障的冗余测试用例。然而,大多数测试用例(套件)最小化技术依赖于代码覆盖(白盒),基于模型的功能,或需求规格,这并不总是由测试工程师访问。最近,一组新的技术被提出,称为FAST-R,完全依赖于测试用例代码的测试用例最小化,这似乎是更有效的比白盒技术。然而,它在Java项目中实现了相当低的故障检测能力,这使得它的应用在实践中具有挑战性。本文提出了ATM(基于AST的测试用例最小化),一个基于相似性,基于搜索的测试用例最小化技术,以特定的预算作为输入,也完全依赖于测试用例的源代码,但试图通过细粒度的相似性分析和专用的搜索算法,以实现更高的故障检测。ATM将测试用例代码转换为抽象树(AST),并依赖于四个基于树的相似性度量来应用进化搜索,特别是遗传算法,以最小化测试用例。我们评估了ATM的有效性和效率的16个Java项目的661个错误的版本使用三个预算范围从25%到75%的测试套件的大型数据集。ATM实现了显着更高的故障检测率(平均0.82),相比FAST-R(平均0.61)和随机最小化(平均0.52),当运行只有50%的测试用例时,在实际可接受的时间内(平均1.1-4.3小时),考虑到最小化只是偶尔应用时,许多新的测试用例被创建(主要版本)。其他预算取得的成果是一致的。
英文摘要:
Executing large test suites is time and resource consuming, sometimes impossible, and such test suites typically contain many redundant test cases. Hence, test case minimization is used to remove redundant test cases that are unlikely to detect new faults. However, most test case (suite) minimization techniques rely on code coverage (white-box), model-based features, or requirements specifications, which are not always accessible by test engineers. Recently, a set of novel techniques was proposed, called FAST-R, relying solely on test case code for test case minimization, which appeared to be much more efficient than white-box techniques. However, it achieved a comparable low fault detection capability for Java projects, making its application challenging in practice. This paper proposes ATM (AST-based Test case Minimizer), a similarity-based, search-based test case minimization technique, taking a specific budget as input, that also relies exclusively on the source code of test cases but attempts to achieve higher fault detection through finer-grained similarity analysis and a dedicated search algorithm. ATM transforms test case code into Abstract Syntax Trees (AST) and relies on four tree-based similarity measures to apply evolutionary search, specifically genetic algorithms, to minimize test cases. We evaluated the effectiveness and efficiency of ATM on a large dataset of 16 Java projects with 661 faulty versions using three budgets ranging from 25% to 75% of test suites. ATM achieved significantly higher fault detection rates (0.82 on average), compared to FAST-R (0.61 on average) and random minimization (0.52 on average), when running only 50% of the test cases, within practically acceptable time (1.1-4.3 hours, on average), given that minimization is only occasionally applied when many new test cases are created (major releases). Results achieved for other budgets were consistent.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。