Skip to main content
QUICK REVIEW

[Paper Review] Chatting with GPT-3 for Zero-Shot Human-Like Mobile Automated GUI Testing

Zhe Liu, Chunyang Chen|arXiv (Cornell University)|May 16, 2023
Software Testing and Debugging TechniquesComputer Science14 citations
TL;DR

GPTDroid treats mobile GUI testing as a Q&A task by using GPT-3 to generate testing scripts from GUI descriptions, then decodes and executes them, achieving higher coverage and bug detection than baselines on Google Play apps.

ABSTRACT

Mobile apps are indispensable for people's daily life, and automated GUI (Graphical User Interface) testing is widely used for app quality assurance. There is a growing interest in using learning-based techniques for automated GUI testing which aims at generating human-like actions and interactions. However, the limitations such as low testing coverage, weak generalization, and heavy reliance on training data, make an urgent need for a more effective approach to generate human-like actions to thoroughly test mobile apps. Inspired by the success of the Large Language Model (LLM), e.g., GPT-3 and ChatGPT, in natural language understanding and question answering, we formulate the mobile GUI testing problem as a Q&A task. We propose GPTDroid, asking LLM to chat with the mobile apps by passing the GUI page information to LLM to elicit testing scripts, and executing them to keep passing the app feedback to LLM, iterating the whole process. Within it, we extract the static context of the GUI page and the dynamic context of the iterative testing process, design prompts for inputting this information to LLM, and develop a neural matching network to decode the LLM's output into actionable steps to execute the app. We evaluate GPTDroid on 86 apps from Google Play, and its activity coverage is 71%, with 32% higher than the best baseline, and can detect 36% more bugs with faster speed than the best baseline. GPTDroid also detects 48 new bugs on the Google Play with 25 of them being confirmed/fixed. We further summarize the capabilities of GPTDroid behind the superior performance, including semantic text input, compound action, long meaningful test trace, and test case prioritization.

Motivation & Objective

  • Formulate automated mobile GUI testing as a Q&A problem using a large language model (LLM).
  • Describe GUI pages semantically to the LLM via static and dynamic context extraction.
  • Decode LLM outputs into executable GUI actions with a neural matching network.
  • Evaluate GPTDroid on real-world Android apps to assess coverage and bug detection.
  • Provide insights into reasons for LLM-driven test effectiveness, including semantic input and test trace quality.

Proposed method

  • Extract static context (app info, current GUI page, and widgets) from AndroidManifest and view hierarchy files.
  • Extract dynamic context (iterative testing progress) via an operation memorizer.
  • Design linguistic prompt patterns and generate prompts for LLM input using static and dynamic context.
  • Use a neural matching network to map LLM-reported steps to concrete GUI widgets for action execution.
  • Employ heuristic-driven training data generation to seed the neural matcher with positive/negative examples.
  • Implement GPTDroid on Android-x86 with UIAutomator and ADB, using GPT-3 as the LLM and PyTorch-based components for decoding and matching.
Figure 1 . Demonstrated example of how GPTDroid works.
Figure 1 . Demonstrated example of how GPTDroid works.

Experimental results

Research questions

  • RQ1What is the effectiveness of GPTDroid in increasing GUI testing activity coverage?
  • RQ2Can GPTDroid detect more bugs and do so faster than baseline GUI testing tools?
  • RQ3How well does the neural matching network translate LLM prompts into valid GUI actions?
  • RQ4What factors explain the success of LLM-driven GUI testing in this setting?

Key findings

  • GPTDroid achieves 71% activity coverage, which is 32% higher than the best baseline.
  • GPTDroid detects 36% more bugs with faster speed than the best baseline.
  • GPTDroid detects 48 new crash bugs on Google Play, with 25 confirmed/fixed by developers.
  • The evaluation used 86 apps and 129 bugs, with comparisons to 9 baselines.
  • Qualitative analysis identifies factors behind performance: semantic text input, compound actions, long test traces, and test case prioritization.
Figure 2 . The model structure of GPT-3.
Figure 2 . The model structure of GPT-3.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.