通过解释一致性检查引导 ChatGPT 修复 Web UI 测试
Guiding ChatGPT to Fix Web UI Tests via Explanation-Consistency Checking
AI总结:
针对 Web UI 测试修复中元素匹配的偏见问题,提出先用现有技术初始匹配,再用 ChatGPT 后续匹配,并通过解释一致性检查缓解幻觉,实验证明能提升修复有效性。
摘要:
Web UI 的快速演进导致 UI 测试维护需要耗费大量时间和精力。现有的 Web UI 测试修复技术主要侧重于在新网页上定位与旧元素匹配的目标元素,以便修复相应的失效语句。这些技术通常依赖于在匹配过程中对某些属性(如 XPath)进行优先级排序,即某些属性的相似度被排在其它属性之前,这表明在匹配过程中可能存在对特定属性的偏见。为了缓解这种偏见,我们首次研究了先使用现有 Web UI 修复技术进行初始匹配,然后使用 ChatGPT 进行后续匹配的可行性。我们的关键洞察是:给定由先前技术匹配的元素列表,ChatGPT 可以利用语言理解进行后续匹配,并使用其代码生成模型修复失效语句。为了减轻 ChatGPT 的幻觉问题,我们设计了一个解释验证器,检查匹配结果提供的解释是否一致,并通过自我修正提示向 ChatGPT 提供提示,以进一步改进其结果。我们在广泛使用的数据集上的评估表明,ChatGPT 增强技术提高了现有 Web 测试修复技术的有效性。我们的研究还为改进未来 Web UI 测试修复技术提供了若干重要见解。
英文摘要:
The rapid evolution of Web UI incurs time and effort in UI test maintenance. Prior techniques in Web UI test repair focus on locating the target elements on the new Webpage that match the old ones so that the corresponding broken statements can be repaired. These techniques usually rely on prioritizing certain attributes (e.g., XPath) during matching where the similarity of certain attributes is ranked before other attributes, indicating that there may be bias towards certain attributes during matching. To mitigate the bias, we present the first study that investigates the feasibility of using prior Web UI repair techniques for initial matching and then using ChatGPT to perform subsequent matching. Our key insight is that given a list of elements matched by prior techniques, ChatGPT can leverage language understanding to perform subsequent matching and use its code generation model for fixing the broken statements. To mitigate hallucination in ChatGPT, we design an explanation validator that checks if the provided explanation for the matching results is consistent, and provides hints to ChatGPT via a self-correction prompt to further improve its results. Our evaluation on a widely used dataset shows that the ChatGPT-enhanced techniques improve the effectiveness of existing Web test repair techniques. Our study also shares several important insights in improving future Web UI test repair techniques.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。