Skip to main content
QUICK REVIEW

[论文解读] LLM for Test Script Generation and Migration: Challenges, Capabilities, and Opportunities

Shengcheng Yu, Chunrong Fang|arXiv (Cornell University)|Sep 24, 2023
Software System Performance and ReliabilityComputer Science被引用 3
一句话总结

本文研究了大型语言模型(LLMs),特别是ChatGPT,在自动化移动应用测试脚本生成及跨平台和应用迁移中的应用。结果表明,LLMs能够有效在不同用户界面、架构和平台间生成和适配测试脚本,但仍在上下文保留、API一致性以及人工介入优化方面面临挑战。

ABSTRACT

This paper investigates the application of large language models (LLM) in the domain of mobile application test script generation. Test script generation is a vital component of software testing, enabling efficient and reliable automation of repetitive test tasks. However, existing generation approaches often encounter limitations, such as difficulties in accurately capturing and reproducing test scripts across diverse devices, platforms, and applications. These challenges arise due to differences in screen sizes, input modalities, platform behaviors, API inconsistencies, and application architectures. Overcoming these limitations is crucial for achieving robust and comprehensive test automation. By leveraging the capabilities of LLMs, we aim to address these challenges and explore its potential as a versatile tool for test automation. We investigate how well LLMs can adapt to diverse devices and systems while accurately capturing and generating test scripts. Additionally, we evaluate its cross-platform generation capabilities by assessing its ability to handle operating system variations and platform-specific behaviors. Furthermore, we explore the application of LLMs in cross-app migration, where it generates test scripts across different applications and software environments based on existing scripts. Throughout the investigation, we analyze its adaptability to various user interfaces, app architectures, and interaction patterns, ensuring accurate script generation and compatibility. The findings of this research contribute to the understanding of LLMs' capabilities in test automation. Ultimately, this research aims to enhance software testing practices, empowering app developers to achieve higher levels of software quality and development efficiency.

研究动机与目标

  • 应对移动应用版本持续演进、设备多样化及多平台环境下测试脚本维护日益增长的挑战。
  • 探究基于自然语言测试场景使用LLMs自动化生成测试脚本的可行性。
  • 评估LLMs在不同平台(如Android到iOS)及功能相似应用之间迁移测试脚本的能力。
  • 识别基于LLM的测试自动化中的关键局限,如上下文记忆能力限制和API使用不一致问题。
  • 为移动软件工程中人工智能驱动的测试自动化研究提供基础。

提出的方法

  • 利用预训练LLMs,特别是ChatGPT,根据测试场景的自然语言描述生成测试脚本。
  • 通过提示LLMs将一种操作系统(如Android)的脚本转换为另一种(如iOS)的方式,评估跨平台测试迁移,考虑用户界面模式和平台特有行为的差异。
  • 通过提示LLMs将一个应用的测试脚本转换为另一个功能相似但内部架构和GUI布局不同的应用,评估跨应用测试迁移。
  • 采用提示工程技术,包括少样本示范和思维链推理,提升LLM在测试脚本生成中的准确性与一致性。
  • 在真实世界移动应用上开展实证评估,分析脚本的正确性、兼容性及所需人工干预程度。
  • 通过生成脚本的定性与定量分析,研究LLM行为,重点关注语义保真度与目标应用的结构一致性。

实验结果

研究问题

  • RQ1LLMs在多大程度上能准确地从移动应用的自然语言测试场景中生成测试脚本?
  • RQ2LLMs在迁移测试脚本至不同平台(如Android到iOS)时,其功能正确性保持效果如何?
  • RQ3LLMs能否成功将测试脚本从一个应用适配到另一个功能相似但架构与GUI设计不同的应用?
  • RQ4基于LLM的测试生成与迁移的主要局限是什么,特别是上下文保留和API一致性方面?
  • RQ5在真实世界测试场景中,修正或验证LLM生成的测试脚本需要多少人工工作量?

主要发现

  • LLMs在从自然语言描述生成测试脚本方面表现出强大能力,与预期测试场景具有高度语义一致性。
  • 跨平台测试迁移具有可行性,但需人工细化,尤其是在处理平台特有UI组件和事件处理机制时。
  • 跨应用测试迁移表现出中等成功率,LLMs能够将脚本适配到功能相似的应用,但因架构和GUI差异常导致生成的脚本错误或无法运行。
  • LLM中上下文记忆能力的限制导致在长或复杂测试场景中行为不一致,需通过迭代提示提升稳定性。
  • 生成脚本中的API使用表现出随机性和不一致性,表明需要更好地与平台特定测试框架对齐。
  • 人工介入验证仍至关重要,需投入大量精力修正LLM生成脚本中的结构、语法和语义错误。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。