The rapid evolution of Web UI incurs time and effort in maintaining UI tests. Existing techniques in Web UI test repair focus on finding the target elements on the new web page that match the old ones so that the corresponding broken statements can be repaired. We present the first study that investigates the feasibility of using prior Web UI repair techniques for initial local matching and then using ChatGPT to perform global matching. Our key insight is that given a list of elements matched by prior techniques, ChatGPT can leverage the language understanding to perform global view matching and use its code generation model for fixing the broken statements. To mitigate hallucination in ChatGPT, we design an explanation validator that checks whether 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.
翻译:Web UI的快速演进耗费大量时间与精力来维护UI测试。现有的Web UI测试修复技术主要聚焦于在新网页上找到与旧元素匹配的目标元素,从而修复相应的失效语句。我们开展了首项研究,探讨了先使用现有Web UI修复技术进行局部匹配,再借助ChatGPT执行全局匹配的可行性。核心思路在于:给定现有技术匹配的元素列表后,ChatGPT能利用语言理解能力执行全局视图匹配,并通过其代码生成模型修复失效语句。为缓解ChatGPT的幻觉问题,我们设计了一个解释验证器,用于检查匹配结果提供的解释是否一致,并通过自我修正提示向ChatGPT提供线索以进一步优化结果。在广泛使用的数据集上的评估表明,ChatGPT增强技术提升了现有Web测试修复技术的有效性。本研究还为改进未来Web UI测试修复技术提供了若干重要见解。