Skip to content

Vallxy/TUSR

Repository files navigation

TUSR: A Test Unit–Based Framework for Repairing Obsolete GUI Test Scripts

Resources

Abstract

Graphical User Interface (GUI) testing is a primary technique for testing mobile applications. Among existing testing methods, script-based testing is widely adopted because test scripts can be replayed across devices and versions. However, as mobile apps evolve, frequent changes to GUI appearance and interaction logic often render scripts written for earlier versions obsolete. Existing repair approaches typically follow a stepwise framework, repairing scripts action by action. While effective for minor GUI appearance changes, they struggle when interaction logic is modified. In this paper, we present TUSR, a test unit–based repair framework that fundamentally departs from the stepwise paradigm. TUSR introduces the concept of a "Test Unit"—a contiguous sequence of test actions serving a single testing intention—and repairs scripts at the unit level. It first splits scripts into test units using a multi-modal LLM with a rule-based correction mechanism to ensure consistency, then conducts dynamic repair guided by a Chain-of-Thought prompt enhanced with reflective memory. Experiments on 20 real-world Android applications, covering 262 test scripts and 3,485 actions, demonstrate that TUSR significantly outperforms state-of-the-art black-box and white-box repair approaches.

Citation

Coming soon

Code

I. Requirement

  • Appium 2.19.0
  • Android SDK
  • Android Emulator(7.1.1)
  • Java 8
  • Python 3.11

II. Artifact && Data Introduction

  • Apks: The folder of all the experimental apps.
  • config: The folder of all the configuration files.
  • log: The folder of all the log files.
  • output: The folder of all the output files. The test script file in under output/[app name]/TestCase.json

III. Preparations

1. Start Appium service

  • Execute appium in the terminal

2. Connect the Android Emulator and the computer

  • This can be verified through executing adb devices in the terminal

3. Install the Python libraries

  • pip install -r requirements.txt

4. Change the API Key

  • Change the value of api-key in config/llm.yaml

5. Modify the configuration file

  • Modify the config/app.yaml to set the real path

IV. Running TUSR

1. Split the test script into test units.

test_case_enhancer.py

  • Change the parameter app_name at line 422.
  • Run test_case_enhancer.py to split the test script into test units.

2. Repair the test script for the updated version app.

test_repairer.py

  • Change the parameter app_name at line 868.
  • Run test_repairer.py to repair all the test scripts for one app.

About

[FSE'26] TUSR: A Test Unit-Based Framework for Repairing Obsolete GUI Test Scripts

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages