[Paper Review] LLM for Test Script Generation and Migration: Challenges, Capabilities, and Opportunities
This paper investigates the use of large language models (LLMs), particularly ChatGPT, for automating mobile app test script generation and migration across platforms and applications. It demonstrates that LLMs can effectively generate and adapt test scripts across diverse UIs, architectures, and platforms, though challenges remain in context retention, API consistency, and human-in-the-loop refinement.
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.
Motivation & Objective
- Address the growing challenge of maintaining test scripts across evolving mobile app versions, diverse devices, and multiple platforms.
- Investigate the feasibility of using LLMs to automate test script generation based on natural language scenarios.
- Evaluate LLMs’ ability to migrate test scripts across different platforms (e.g., Android to iOS) and similar-functionality apps.
- Identify key limitations in LLM-based test automation, such as context memory constraints and inconsistent API usage.
- Provide a foundation for future research on AI-driven test automation in mobile software engineering.
Proposed method
- Leveraged pre-trained LLMs, particularly ChatGPT, to generate test scripts from natural language descriptions of test scenarios.
- Evaluated cross-platform test migration by prompting LLMs to adapt scripts from one OS (e.g., Android) to another (e.g., iOS), considering differences in UI patterns and platform-specific behaviors.
- Assessed cross-app test migration by prompting LLMs to transform test scripts from one app to another with similar functionality but different internal architectures and GUI layouts.
- Used prompt engineering techniques, including few-shot demonstrations and chain-of-thought reasoning, to improve LLM accuracy and consistency in test script generation.
- Conducted empirical evaluation on real-world mobile apps to analyze script correctness, compatibility, and required human intervention.
- Analyzed LLM behavior through qualitative and quantitative analysis of generated scripts, focusing on semantic fidelity and structural alignment with target apps.
Experimental results
Research questions
- RQ1To what extent can LLMs accurately generate test scripts from natural language test scenarios in mobile applications?
- RQ2How effective are LLMs in migrating test scripts across different platforms (e.g., Android to iOS) while preserving functional correctness?
- RQ3Can LLMs successfully adapt test scripts from one app to another with similar functionality but differing architectures and GUI designs?
- RQ4What are the primary limitations of LLM-based test generation and migration, particularly regarding context retention and API consistency?
- RQ5How much human effort is required to correct or validate LLM-generated test scripts in real-world testing scenarios?
Key findings
- LLMs demonstrated strong capability in generating test scripts from natural language descriptions, achieving high semantic alignment with intended test scenarios.
- Cross-platform test migration was feasible but required manual refinement, especially when handling platform-specific UI components and event handling mechanisms.
- Cross-app test migration showed moderate success, with LLMs able to adapt scripts between functionally similar apps, though architectural and GUI differences often led to incorrect or non-functional scripts.
- Context memory limitations in LLMs resulted in inconsistent behavior across long or complex test scenarios, requiring iterative prompting for stability.
- API usage in generated scripts exhibited randomness and inconsistency, indicating a need for better grounding in platform-specific testing frameworks.
- Human-in-the-loop validation remained essential, with significant effort required to correct structural, syntactic, and semantic errors in LLM-generated scripts.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.