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 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.
翻译:执行大型测试套件需要时间和资源,有时是不可能做到的,而且这种测试套件通常包含许多多余的测试案例。因此,将测试案件减到最小化是为了消除无法发现新故障的多余测试案例。然而,大多数测试案件减到最小化技术都依赖于代码覆盖率(白箱),基于模型的特征或要求规格,测试工程师并不总是能够获得这些代码。最近,提出了一套新技术,称为FAST-R,仅仅依靠测试案例代码来最大限度地减少测试案例,似乎比白箱技术效率高得多。然而,它为爪哇项目实现了相似的低误差检测能力,使得其应用在实践上具有挑战性。本文建议ATM(基于ST的测试案件减到最小化),基于类似性、基于搜索的测试套件的最小化测试套件,将特定预算作为投入,这也完全依赖于测试案例的来源代码,但试图通过精细的类似分析以及专门的搜索算法来提高误差度。ATM将平均的代码转换为缩略图(AST),并依靠四个基于树基的更精确的测试套件的测试套件,具体地测试套件,使用25号的测算算,在测试套测算中,而我们测算中测算算为平均测算了平均时间里测算中,而只测算了75的测算。