arXivDaily arXiv每日学术速递 周一至周五更新
北美退伍军人节(Veterans Day),12 日无更新
arXiv 2602.19294cs.SE
收藏

基于大语言模型的网页测试用例自动生成方法

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有限公司)

Betül Karagöz, Filippo Ricca, Matteo Biagiola, Andrea Stocco

AI总结:

本文研究了利用大语言模型自动生成网页测试用例页面对象的可行性,通过实证分析展示了其在准确性与元素识别率上的表现。

摘要:

页面对象(POs)是一种广泛采用的设计模式,用于提高自动化端到端网页测试的可维护性和可扩展性。然而,创建和维护POs仍然主要是手动且劳动密集型的活动,而自动化解决方案在实际应用中受到限制。在这一背景下,大语言模型(LLMs)在这些任务中的潜力尚未得到充分探索。本文通过实证研究探讨了使用LLMs,特别是GPT-4o和DeepSeek Coder,自动为网页测试生成POs的可行性。我们评估了生成的成果在现有五个网页应用基准测试中的表现,这些应用已手动编写了POs(即真实数据),重点在于准确性(即正确识别真实数据元素的比例)和元素识别率(即正确识别或标记修改的真实数据元素比例)。我们的结果显示,LLMs可以生成语法正确且功能有用的POs,其准确性范围从32.6%到54.0%,元素识别率在大多数情况下超过70%。本研究为LLMs在自动化PO生成中的优势和开放挑战提供了首次系统评估,并为进一步研究如何将LLMs整合到实际测试流程中提供了方向。

英文摘要:

Page Objects (POs) are a widely adopted design pattern for improving the maintainability and scalability of automated end-to-end web tests. However, creating and maintaining POs is still largely a manual, labor-intensive activity, while automated solutions have seen limited practical adoption. In this context, the potential of Large Language Models (LLMs) for these tasks has remained largely unexplored. This paper presents an empirical study on the feasibility of using LLMs, specifically GPT-4o and DeepSeek Coder, to automatically generate POs for web testing. We evaluate the generated artifacts on an existing benchmark of five web applications for which manually written POs are available (the ground truth), focusing on accuracy (i.e., the proportion of ground truth elements correctly identified) and element recognition rate (i.e., the proportion of ground truth elements correctly identified or marked for modification). Our results show that LLMs can generate syntactically correct and functionally useful POs with accuracy values ranging from 32.6% to 54.0% and element recognition rate exceeding 70% in most cases. Our study contributes the first systematic evaluation of LLMs strengths and open challenges for automated PO generation, and provides directions for further research on integrating LLMs into practical testing workflows.

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

↑