Web test automation techniques often rely on crawlers to infer models of web applications for automated test generation. However, current crawlers rely on state equivalence algorithms that struggle to distinguish near-duplicate pages, often leading to redundant test cases and incomplete coverage of application functionality. In this paper, we present a model-based test generation approach that employs transformer-based Siamese neural networks (SNNs) to infer web application models more accurately. By learning similarity-based representations, SNNs capture structural and textual relationships among web pages, improving near-duplicate detection during crawling and enhancing the quality of inferred models, and thus, the effectiveness of generated test suites. Our evaluation across nine web apps shows that SNNs outperform state-of-the-art techniques in near-duplicate detection, resulting in superior web app models with an average F-1 score improvement of 56%. These enhanced models enable the generation of more effective test suites that achieve higher code coverage, with improvements ranging from 6% to 21% and averaging at 12%.
翻译:Web测试自动化技术通常依赖爬虫来推断Web应用程序的模型,以生成自动化测试用例。然而,当前的爬虫依赖于状态等价算法,这些算法难以区分近似重复页面,常常导致冗余测试用例以及对应用程序功能覆盖的不完整。本文提出一种基于模型的测试生成方法,该方法采用基于Transformer的孪生神经网络来更精确地推断Web应用程序模型。通过学习基于相似性的表示,孪生神经网络能够捕捉网页间的结构性和文本性关联,从而改进爬取过程中的近似重复检测,提升推断模型的质量,进而提高所生成测试套件的有效性。我们在九个Web应用程序上的评估表明,孪生神经网络在近似重复检测方面优于现有先进技术,由此产生的Web应用程序模型更优,平均F1分数提升了56%。这些增强后的模型能够生成更有效的测试套件,实现更高的代码覆盖率,其提升幅度在6%至21%之间,平均为12%。