With the ever-increasing use of web APIs in modern-day applications, it is becoming more important to test the system as a whole. In the last decade, tools and approaches have been proposed to automate the creation of system-level test cases for these APIs using evolutionary algorithms (EAs). One of the limiting factors of EAs is that the genetic operators (crossover and mutation) are fully randomized, potentially breaking promising patterns in the sequences of API requests discovered during the search. Breaking these patterns has a negative impact on the effectiveness of the test case generation process. To address this limitation, this paper proposes a new approach that uses agglomerative hierarchical clustering (AHC) to infer a linkage tree model, which captures, replicates, and preserves these patterns in new test cases. We evaluate our approach, called LT-MOSA, by performing an empirical study on 7 real-world benchmark applications w.r.t. branch coverage and real-fault detection capability. We also compare LT-MOSA with the two existing state-of-the-art white-box techniques (MIO, MOSA) for REST API testing. Our results show that LT-MOSA achieves a statistically significant increase in test target coverage (i.e., lines and branches) compared to MIO and MOSA in 4 and 5 out of 7 applications, respectively. Furthermore, LT-MOSA discovers 27 and 18 unique real-faults that are left undetected by MIO and MOSA, respectively.
翻译:随着在现代应用中越来越多地使用网络API,对整个系统进行测试就变得日益重要了。在过去十年中,有人提议采用新的工具和方法,利用进化算法(EAs)使创建这些API的系统级测试案例自动化。EAs的一个限制因素是,基因操作者(交叉和突变)完全随机化,有可能打破在搜索过程中发现的API要求序列中的有希望模式。打破这些模式对测试案例生成过程的实效有负面影响。为了应对这一限制,本文建议采用一种新的方法,利用集聚性等级分组(AHC)来推断一种链接树模型,该模型将捕捉、复制和保存这些模式在新的测试案例中。我们评价我们的方法,称为LT-MOSA,对7个真实世界基准应用程序的覆盖和真实失灵检测能力进行实证研究。我们还将TT-MOSA与现有的两种状态的无端测试技术(MIO、MOSA)分别用于捕获、复制18个目标的RILT 和MALT 4系列的统计测试结果。