arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2402.09745cs.SE
收藏

WEFix:智能自动生成显式等待以实现高效的 Web 端到端不稳定测试

WEFix: Intelligent Automatic Generation of Explicit Waits for Efficient Web End-to-End Flaky Tests

Xinyue Liu, Zihe Song, Weike Fang, Wei Yang, Weihang Wang

AI总结:

本文提出 WEFix,通过浏览器 UI 变化预测客户端代码执行并自动生成显式等待预言,以修复 Web 端到端测试中的 UI 型不稳定问题,实验显示其正确率达 98%,开销由 3.7× 降至 1.25×。

摘要:

Web 端到端(e2e)测试用于评估 Web 应用程序的工作流。它模拟真实世界的用户场景,以确保应用流程按预期运行。然而,Web e2e 测试因不稳定而臭名昭著,即在代码没有任何更改的情况下,测试也可能产生不一致的结果。一种常见的不稳定类型是由测试代码与被测客户端代码之间不确定的执行顺序引起的。特别是,基于 UI 的不稳定性已成为一个非常普遍且极具挑战性的修复问题,因为测试代码对客户端代码执行情况的了解有限。本文提出 WEFix,这是一种能够为 Web e2e 测试中基于 UI 的不稳定性自动生成修复代码的技术。我们方法的核心是利用浏览器 UI 变化来预测客户端代码的执行,并生成适当的等待预言。我们针对来自七个流行真实项目的 122 个 Web e2e 不稳定测试评估了 WEFix 的有效性和效率。结果表明,WEFix 在实现 98% 高正确率的同时,将开销从 3.7× 大幅降低至 1.25×。

英文摘要:

Web end-to-end (e2e) testing evaluates the workflow of a web application. It simulates real-world user scenarios to ensure the application flows behave as expected. However, web e2e tests are notorious for being flaky, i.e., the tests can produce inconsistent results despite no changes to the code. One common type of flakiness is caused by nondeterministic execution orders between the test code and the client-side code under test. In particular, UI-based flakiness emerges as a notably prevalent and challenging issue to fix because the test code has limited knowledge about the client-side code execution. In this paper, we propose WEFix, a technique that can automatically generate fix code for UI-based flakiness in web e2e testing. The core of our approach is to leverage browser UI changes to predict the client-side code execution and generate proper wait oracles. We evaluate the effectiveness and efficiency of WEFix against 122 web e2e flaky tests from seven popular real-world projects. Our results show that WEFix dramatically reduces the overhead (from 3.7$\times$ to 1.25$\times$) while achieving a high correctness (98%).

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑