一句话:提出 UITestFix,用迭代元素匹配算法提高 Web UI 测试修复中元素匹配的准确率与修复正确性。
Web 应用频繁更新后,UI 测试需要同步更新以支持回归测试,但人工维护成本高,自动修复因而受到关注。自动修复的关键步骤是匹配网页更新前后的 UI 元素。已有方法依赖视觉信息、属性值或 DOM 结构,但匹配准确率较低,或仅适用于简单 UI 测试。本文提出 UITestFix,其核心是一种新颖的迭代匹配算法:一方面利用元素之间的关系(超越属性与 DOM 结构)来指导匹配,另一方面用前一轮迭代的匹配结果指导当前轮匹配。作者在公开数据集与两个工业应用上进行了评估,结果表明 UITestFix 在元素匹配准确率和修复正确性上均优于四种现有方法。
Web UI test cases are used for the automatic testing of web applications. When a web application is updated, these UI tests should also be updated for regression testing of the new version of web application. With the rapid evolution, updating UI tests is a tedious and time-consuming task. To solve these problems, automatically repairing web UI tests has gained increasing attention recently. To repair web UI tests, the most important step is to match the UI elements before and after the web page update. Existing work matches UI elements according to visual information, attributes value, or Document Object Model (DOM) structures. However, they either achieve low element matching accuracy or only work on simple UI tests. To solve these problems, we proposed UITestFix, an approach based on a novel iterative matching algorithm for improving the accuracy of matching UI elements. UITestFix is designed based on two main insights: (1) beyond attribute and DOM structures, the relations between different elements can also guide the matching process, and (2) the matching results of previous iterations could guide the matching of the current iteration. Our evaluation of publicly available datasets and two industrial apps shows that UITestFix outperforms four existing approaches by achieving more accurate element matching and producing more correct fixes.