Manuscript Offprint

arXiv:2608.25425

RotDroid: Cross-Orientation State Equivalence Testing for Detecting GUI Rotation Bugs in Android Apps

Mengdi Qin, Bo Jiang

Mengdi Qin

SKLCCSE

Beihang University

Beijing 100191, China

qinmengdi@buaa.edu.cn

Bo Jiang ∗^{*}

SKLCCSE

Beihang University

Beijing 100191, China

jiangbo@buaa.edu.cn

Abstract—Screen rotation is a fundamental interaction in Android applications, but it often introduces non-crashing functional failures (NCFs), such as layout inconsistencies and state loss, which are difficult to detect automatically. A key challenge is the lack of effective test oracles for checking cross-orientation state equivalence between portrait and landscape views. We propose RotDroid, a testing framework for detecting GUI rotation bugs via cross-orientation state equivalence. RotDroid generates and mutates State-Preserving action Sequences (SPS) to construct semantically equivalent GUI states across orientations. To support reliable oracle checking, we build RotBench, a dataset of paired portrait–landscape GUI states, and develop RotVL, a vision-language model fine-tuned for equivalence checking. Experiments on both synthetic and real-world datasets show that RotVL outperforms state-of-the-art models, and RotDroid detects more rotation-induced failures than existing techniques under equal budgets. In large-scale studies on open- and closed-source apps, RotDroid reports 94 previously unknown bugs, with 47 confirmed or fixed by developers, demonstrating its practical effectiveness.

Index Terms—Android GUI Testing, GUI Rotation Bugs, Cross-orientation State Equivalence, Vision Language Models

I. INTRODUCTION

Screen orientation change is a common form of runtime configuration change in mobile applications. With recent Android policies mandating orientation flexibility [1], applications are required to support seamless layout adaptation across portrait and landscape modes. However, correct adaptation remains challenging due to the Android lifecycle mechanism, where orientation changes trigger a destroy-and-recreate process that requires developers to manually preserve transient states [2]. As a result, orientation changes frequently introduce non-crashing functional (NCF) defects [2], [3], such as component occlusion [4] or data loss [5], [6]. Unlike crashes, these defects manifest as silent functional impairments, making them difficult to detect with existing testing techniques.

Existing automated testing approaches have limited effectiveness in detecting such GUI rotation bugs. GUI exploration tools primarily target crashes and overlook visual logic errors, while vision-based approaches [4] focus on anomalies within a single static view and cannot capture cross-orientation inconsistencies. Techniques based on structural similarity [7] are inapplicable due to differing screen layouts across orientations. Methods that validate state restoration after consecutive orientation changes (DOC) (i.e., Portrait → Landscape → Portrait) [2] miss defects in intermediate states, and data-loss detectors [5], [6] fail to identify layout-related issues. Although recent multimodal approaches [8] leverage large vision-language models, they lack the domain-specific knowledge required to distinguish valid layout adaptation from rotation-induced defects.

In summary, detecting GUI rotation bugs faces two key challenges. First, designing an effective oracle for cross-orientation state equivalence is difficult, as it requires accurately determining whether portrait and landscape views represent the same semantic state. Second, rotation bugs are difficult to expose through naive orientation switching alone, as they often manifest only when orientation changes are interleaved with user interactions.

To address these challenges, we propose a systematic framework for cross-orientation GUI testing. We first conduct an empirical study to characterize GUI rotation bugs, which informs the construction of RotBench, a dataset of both equivalent and non-equivalent portrait–landscape GUI pairs. Based on this dataset, we develop RotVL, a vision-language model for cross-orientation state equivalence checking. Building on this oracle, we design RotDroid, an automated testing framework that generates and mutates state-preserving action sequences (SPS) to construct semantically equivalent GUI states across orientations. RotDroid then leverages RotVL to analyze these paired states and detect rotation-induced inconsistencies.

Our results show that RotVL-8B outperforms state-of-the-art vision-language models, including Qwen3-VL-235B-A22B-Instruct and GPT-5.2, on cross-orientation bug detection tasks. In large-scale evaluations on 300 open-source and 103 commercial Android applications, RotDroid reports 72 previously unknown bugs in open-source apps (41 confirmed and 29 fixed) and 22 previously unknown bugs in commercial

∗^{*}Bo Jiang is the corresponding author.

apps (6 confirmed), demonstrating its effectiveness in detecting real-world GUI rotation issues.

In summary, the contributions of this work are as follows:

• We conduct an empirical study to systematically characterize GUI rotation bugs and derive a taxonomy that informs the design of our approach.

• We introduce RotBench, a dataset of paired portrait–landscape GUI states with both equivalent and non-equivalent cases, and develop RotVL, a vision-language model to support cross-orientation state equivalence checking.

• We propose RotDroid, an automated testing framework that generates and mutates state-preserving action sequences (SPS) to construct semantically equivalent GUI states across orientations and detect rotation-induced inconsistencies.

• We evaluate RotDroid on large-scale open-source and commercial Android applications, where it identifies numerous previously unknown GUI rotation bugs, many of which have been confirmed or fixed by developers.

References (34)

  • The future is adaptive: Changes to orientation and resizingability apis in android 16
  • Why does the orientation change mess up my android application? from gui failures to code faults
  • A study of using multimodal llms for non-crash functional bug detection in android apps
  • Nighthawk: Fully automated localizing ui display issues via visual understanding
  • Data loss detector: automatically revealing data loss bugs in android apps
  • ifixdataloss: a tool for detecting and fixing data loss issues in android apps
  • Automated cross-platform inconsistency detection for mobile apps
  • Seeing is believing: Vision-driven non-crash functional bug detection for mobile apps
  • Qwen3-VL Technical Report
  • Droidbot: a lightweight ui-guided test input generator for android
  • Guided, stochastic model-based gui testing of android apps
  • uiautomator2
  • Llamafactory: Unified efficient fine-tuning of 100+ language models
  • Izzyondroid f-droid repository
  • Note on the sampling error of the difference between correlated proportions or percentages
  • Individual comparisons by ranking methods
  • Packt Publishing, 2013
  • Software testing automation using appium
  • Dynodroid: An input generation system for android apps
  • Sapienz: Multi-objective automated testing for android applications
  • Deep reinforcement learning for black-box testing of android apps
  • Effectively modeling ui transition graphs for android apps via reinforcement learning
  • Effective, platform-independent gui testing via image embedding and reinforcement learning
  • Lirat: Layout and image recognition driving automated mobile testing of cross-platform
  • Woodpecker: identifying and fixing android ui display issues
  • Chatting with gpt-3 for zero-shot human-like mobile automated gui testing (opens arXiv in a new tab)
  • Autodroid: Llm-powered task automation in android
  • Fill in the blank: Context-aware automated text input generation for mobile gui testing
  • Ferret-ui: Grounded mobile ui understanding with multimodal llms
  • Automated soap opera testing directed by llms and scenario knowledge: Feasibility, challenges, and road ahead
  • Standing on the shoulders of giants: Bug-aware automated gui testing via retrieval augmentation
  • From perception to reasoning: Enhancing vision-language models for mobile ui understanding
  • Cross-device difference detector for mobile application gui compatibility testing
  • The metamorphosis: Automatic detection of scaling issues for mobile apps