Web表单测试是保障Web应用质量的核心工作,通常需要评估用户与表单之间的交互行为。自动化测试用例生成始终是Web表单测试领域的一大难题:由于Web页面存在复杂的多层级结构,自动化捕获其内在上下文信息并将其融入测试过程存在较大难度。大语言模型(Large Language Models, LLMs)已在上下文文本生成任务中展现出巨大潜力,这促使我们探索如何利用LLMs结合表单元素内的上下文信息,生成Web表单自动化测试。据我们所知,目前尚无针对不同LLM在Web表单测试生成任务中的对比研究。为填补这一文献空白,我们开展了一项全面的实证研究,在来自30个开源Java Web应用的146个Web表单上,调研了11种LLM的测试生成效果。此外,我们提出了三种HTML结构剪枝方法,用于提取关键上下文信息。实验结果表明,不同LLM的测试效果存在差异:与GPT-4相比,其余LLM难以生成适配Web表单的合理测试,它们的成功提交率(Successfully-Submitted Rates, SSRs)下降幅度在9.10%至74.15%之间。研究结果还显示,对于所有LLM而言,当设计的提示词包含完整清晰的Web表单上下文信息时,生成的Web表单测试效果更优。具体而言,使用“解析器处理的HTML作为任务提示(Parser-Processed HTML for Task Prompt, PH-P)”时,平均SSR达70.63%,高于“原始HTML作为任务提示(Raw HTML for Task Prompt, RH-P)”的60.21%,以及“LLM处理的HTML作为任务提示(LLM-Processed HTML for Task Prompt, LH-P)”的50.27%。最后,本文还总结了基于性能指标选择LLM、优化提示词设计以提升Web表单测试质量的策略。
英文摘要:
Testing web forms is an essential activity for ensuring the quality of web applications. It typically involves evaluating the interactions between users and forms. Automated test-case generation remains a challenge for web-form testing: Due to the complex, multi-level structure of web pages, it can be difficult to automatically capture their inherent contextual information for inclusion in the tests. Large Language Models (LLMs) have shown great potential for contextual text generation. This motivated us to explore how they could generate automated tests for web forms, making use of the contextual information within form elements. To the best of our knowledge, no comparative study examining different LLMs has yet been reported for web-form-test generation. To address this gap in the literature, we conducted a comprehensive empirical study investigating the effectiveness of 11 LLMs on 146 web forms from 30 open-source Java web applications. In addition, we propose three HTML-structure-pruning methods to extract key contextual information. The experimental results show that different LLMs can achieve different testing effectiveness. Compared with GPT-4, the other LLMs had difficulty generating appropriate tests for the web forms: Their successfully-submitted rates (SSRs) decreased by 9.10% to 74.15%. Our findings also show that, for all LLMs, when the designed prompts include complete and clear contextual information about the web forms, more effective web-form tests were generated. Specifically, when using Parser-Processed HTML for Task Prompt (PH-P), the SSR averaged 70.63%, higher than the 60.21% for Raw HTML for Task Prompt (RH-P) and 50.27% for LLM-Processed HTML for Task Prompt (LH-P). Finally, this paper also highlights strategies for selecting LLMs based on performance metrics, and for optimizing the prompt design to improve the quality of the web-form tests.
Towards Automated Page Object Generation for Web Testing using Large Language Models
Technical University of Munich(慕尼黑工业大学);Università degli Studi di Genova(热那亚大学);University of St. Gallen and USI(圣加仑大学和瑞士意大利语联邦理工学院);fortiss GmbH(fortiss有限公司)
Understanding Automated Web GUI Testing: An Empirical Study Across Exploration Strategies and State Abstractions
SCS, Peking University(北京大学计算科学研究所);Key Lab of HCST (PKU), MOE(北京大学智能技术与系统国家重点实验室);University of Texas at Dallas(德克萨斯大学达拉斯分校);National Engineering Research Center of Software Engineering, MOE(软件工程国家工程研究中心)
Memetic EDA-Based Approaches to Comprehensive Quality-Aware Automated Semantic Web Service Composition
School of Engineering and Computer Science, Victoria University of Wellington(惠灵顿维多利亚大学工程与计算机科学学院);Department of Informatics, Clausthal University of Technology(克劳斯塔尔工业大学信息学系)
Maintenance of Automated Test Suites in Industry: An Empirical study on Visual GUI Testing
验证与确认(Verification and Validation,V&V)活动在实践中占软件系统总开发成本的20%到50%。测试自动化被提出来降低这些V&V成本,但现有的研究只提供了有限的经验数据,从工业实践中的维护成本的自动化测试和影响这些成本的因素。特别是,这些成本和因素对于基于GUI的自动化测试是未知的。目的:本文通过分析与工业实践中基于GUI的自动化测试维护相关的成本和因素,解决了这种知识的缺乏。方法:在两个公司,西门子和萨博,实证研究报告的采访,和实证工作,可视化GUI测试进行获取数据的技术的维护成本和可行性。结果:观察到13个因素,影响维修,如测试人员的知识/经验和测试用例的复杂性。此外,统计分析表明,开发新的测试脚本比维护成本更高,但频繁的维护比不频繁的大爆炸维护成本更低。此外,成本模型,在以前的工作的基础上,提出了估计的时间,以积极的投资回报率(ROI)的测试自动化相比,手动测试。结论:它的结论是,测试自动化可以降低一个项目的整体软件开发成本,同时也对软件质量有积极的影响。然而,维护成本仍然是相当可观的,公司目前花在手动测试上的时间越少,在自动化之后达到积极的、经济的ROI之前需要的时间就越多。
ACCESS: Prompt Engineering for Automated Web Accessibility Violation Corrections
Carlmont High School(卡尔蒙特高中);Crofton House School(克罗夫顿豪斯学校);Lynbrook High School(林布鲁克高中);International School of Zug and Luzern(楚格与卢塞恩国际学校);Columbia University(哥伦比亚大学);Taipei American School(台北美国学校);University of Illinois Urbana-Champaign(伊利诺伊大学厄巴纳-香槟分校);University of California Berkeley(加州大学伯克利分校)