一句话:提出静态分析工具 IMGDroid,基于五类反模式检测 Android 应用中的图像加载缺陷。
图像对 Android 应用的功能与体验至关重要,但不当的图像加载与显示会影响性能和质量,且这类缺陷往往不会立即导致崩溃,现有 GUI 测试难以有效发现。论文首先归纳出五类图像加载反模式:通过 Intent 传递图片、解码时不缩放、本地图片加载缺少权限、重复解码不使用缓存,以及在 UI 线程中解码。基于这些反模式,作者提出静态分析技术 IMGDroid,自动检测上述缺陷。在 21 个开源 Android 应用基准上,IMGDroid 不仅成功检出 45 个已知图像加载缺陷,还发现 15 个新缺陷;对 1000 个商业 Android 应用的实证研究表明,这类图像加载缺陷十分普遍。
Images are essential for many Android applications or apps. Although images play a critical role in app functionalities and user experience, inefficient or improper image loading and displaying operations may severely impact the app performance and quality. Additionally, since these image loading defects may not be manifested by immediate failures, e.g., app crashes, existing GUI testing approaches cannot detect them effectively. In this paper, we identify five anti-patterns of such image loading defects, including image passing by intent, image decoding without resizing, local image loading without permission, repeated decoding without caching, and image decoding in UI thread. Based on these anti-patterns, we propose a static analysis technique, IMGDroid, to automatically and effectively detect such defects. We have applied IMGDroid to a benchmark of 21 open-source Android apps, and found that it not only successfully detects the 45 previously-known image loading defects but also finds 15 new such defects. Our empirical study on 1,000 commercial Android apps demonstrates that the image loading defects are prevalent.