RotDroid: Cross-Orientation State Equivalence Testing for Detecting GUI Rotation Bugs in Android Apps
Organizations: SKLCCSE Beihang University Beijing 100191, China
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.
Figures & tables
| Category | Bug Type | Percentage | Description |
| Rotation Execution Failures | Unintended Rotation | 18% | The screen or UI elements rotate unnecessarily when should remain fixed. |
| No Rotation | 16% | The screen or UI elements fail to rotate when the device orientation changes. | |
| Layout Failures | Content Clipping | 14% | Parts of the content or components are truncated or extend beyond the visible screen. |
| Component Absence | 12% | Essential UI elements are not displayed or rendered correctly. | |
| Component Overlap | 9% | UI components or contents overlap or obscure each other. | |
| State Restoration Failures | Navigation State Loss | 12% | The scroll position, pagination, or other navigational state return to default position. |
| Task | Training Set | Validation Set | Test Set | Total | ||||
|---|---|---|---|---|---|---|---|---|
| # Samples | # Apps | # Samples | # Apps | # Samples | # Apps | # Samples | # Apps | |
| Bug Detection | 2,960 | 502 | 320 | 59 | 340 | 62 | 3,620 | 623 |
| Bug Classification and Localization | 2,300 | 425 | 320 | 51 | 340 | 54 | 2,960 | 530 |
| Model | Bug Detection (%) | Bug Classification (%) | Bug Loc. (Orient.) (%) | Bug Loc. (Coord.) | ||||||||||
| Acc. | Prec. | Rec. | F1 | Acc. | Prec. | Rec. | F1 | Acc. | Prec. | Rec. | F1 | Dist. (px) | Ratio | |
| Qwen3-VL-2B | 53.24 | 62.82 | 53.24 | 42.48 | 20.59 | 8.76 | 20.59 | 9.56 | 54.12 | 54.41 | 54.12 | 53.34 | 466 | 73.29 |
| Qwen3-VL-4B | 61.47 | 61.54 | 61.47 | 61.41 | 21.47 | 20.54 | 21.47 | 13.03 | 52.06 | 75.53 | 52.06 | 37.75 | 499 | 53.72 |
| Qwen3-VL-8B | 66.47 | 67.65 | 66.47 | 65.90 | 30.59 | 52.49 | 30.59 | 26.02 | 54.41 | 69.03 | 54.41 | 43.58 | 435 | 38.45 |
| Qwen3-VL-32B | 58.82 | 59.73 | 58.82 | 57.84 | 30.00 | 65.02 | 30.00 | 25.89 | 53.82 | 75.99 | 53.82 | 41.31 | 478 | 30.07 |
| Qwen3-VL-235B | 60.00 | 60.72 | 60.00 | 59.32 | 37.06 | 46.05 | 37.06 | 33.77 | 56.18 | 74.48 | 56.18 | 46.10 | 459 | 45.06 |
| Model | Acc. | Prec. | Rec. | F1 |
|---|---|---|---|---|
| Qwen3-VL-8B | 63.00 | 70.22 | 63.00 | 66.41 |
| GPT-5.2 | 65.00 | 59.21 | 65.00 | 61.97 |
| RotVL-8B | 70.00 | 74.81 | 70.00 | 72.32 |
| Methods | RotDroid | DLD | iFixDataloss | ||||
|---|---|---|---|---|---|---|---|
| Metrics | T | TP | FP | T | TP | FP | T |
| #Unique Bugs | 354 | 300 | 54 | 219 | 167 | 52 | 125 |
| Methods | RotDroid | DOC | ||||
|---|---|---|---|---|---|---|
| Metrics | T | TP | FP | T | TP | FP |
| #Unique Bugs | 318 | 268 | 50 | 161 | 139 | 22 |
| Bug Category | Confirmed | Pending | Rejected |
|---|---|---|---|
| Layout Failures | 21 | 13 | 0 |
| State Restoration Failures | 25 | 15 | 1 |
| Rotation Execution Failures | 1 | 3 | 0 |
| Total | 47 | 30 | 1 |
| #1 | Dropbox | #5 | ibis* | #9 | Tasks | #13 | MANGA* | #17 | Toomics |
|---|---|---|---|---|---|---|---|---|---|
| #2 | Phone* | #6 | ReadEra | #10 | Canvas | #14 | Yr | #18 | Zillow |
| #3 | Health | #7 | Infinite* | #11 | Walli | #15 | Cabify* | #19 | US News |
| #4 | Lark* | #8 | Cars* | #12 | Trulia | #16 | Fuelio | #20 | OurFa* |
| * denotes abbreviated application names. | |||||||||
Fault Detection
Fault detection identifies abnormal behavior in machines, sensors, infrastructure, software, and autonomous systems before it causes harm or disruption.
See all 105 papers