当前位置: X-MOL 学术arXiv.cs.SE › 论文详情
Our official English website, www.x-mol.net, welcomes your feedback! (Note: you will need to create a separate account there.)
Improving Test Case Generation for REST APIs Through Hierarchical Clustering
arXiv - CS - Software Engineering Pub Date : 2021-09-14 , DOI: arxiv-2109.06655
Dimitri Stallenberg, Mitchell Olsthoorn, Annibale Panichella

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.

中文翻译:

通过分层聚类改进 REST API 的测试用例生成

随着现代应用程序中越来越多地使用 Web API,测试整个系统变得越来越重要。在过去十年中,已经提出了使用进化算法 (EA) 为这些 API 自动创建系统级测试用例的工具和方法。EA 的限制因素之一是遗传算子(交叉和变异)是完全随机的,这可能会破坏搜索过程中发现的 API 请求序列中的有希望的模式。打破这些模式会对测试用例生成过程的有效性产生负面影响。为了解决这个限制,本文提出了一种使用凝聚层次聚类 (AHC) 来推断链接树模型的新方法,该模型在新的测试用例中捕获、复制和保留这些模式。我们通过对 7 个真实世界基准应用程序 wrt 分支覆盖率和实际故障检测能力进行实证研究来评估我们的方法,称为 LT-MOSA。我们还将 LT-MOSA 与用于 REST API 测试的两种现有的最先进的白盒技术(MIO、MOSA)进行了比较。我们的结果表明,与 MIO 和 MOSA 相比,LT-MOSA 分别在 7 个应用程序中的 4 个和 5 个应用程序中实现了测试目标覆盖率(即线路和分支)的统计显着增加。此外,LT-MOSA 分别发现了 MIO 和 MOSA 未检测到的 27 个和 18 个独特的实际故障。MOSA) 用于 REST API 测试。我们的结果表明,与 MIO 和 MOSA 相比,LT-MOSA 分别在 7 个应用程序中的 4 个和 5 个应用程序中实现了测试目标覆盖率(即线路和分支)的统计显着增加。此外,LT-MOSA 分别发现了 MIO 和 MOSA 未检测到的 27 个和 18 个独特的实际故障。MOSA) 用于 REST API 测试。我们的结果表明,与 MIO 和 MOSA 相比,LT-MOSA 分别在 7 个应用程序中的 4 个和 5 个应用程序中实现了测试目标覆盖率(即线路和分支)的统计显着增加。此外,LT-MOSA 分别发现了 MIO 和 MOSA 未检测到的 27 个和 18 个独特的实际故障。
更新日期:2021-09-15
down
wechat
bug