Android应用程序中的低效图像显示问题的理解与检测
Understanding and Detecting Inefficient Image Displaying Issues in Android Apps
-
摘要:研究背景 智能手机和平板电脑等移动设备已成为人们日常生活中不可或缺的一部分。这些移动设备中所使用到的媒体密集型应用程序在功能上越来越丰富,经常包含涉及高CPU和内存消耗的图像显示功能。如果应用程序开发者在图像显示功能上存在低效的实现,将使得应用程序中存在低效图像显示(inefficient image displaying, IID)问题,导致应用程序崩溃、UI响应滞后、内存膨胀或电量耗尽,使得用户体验会受到显著影响,甚至最终导致用户放弃并卸载应用程序。因此,我们需要对IID问题的特征有充分的理解,同时开发自动化的IID问题检测工具。但是,而在现有研究工作中,还不存在专门对IID问题进行系统性分析和自动检测的工作。目的 移动应用程序通常需要显示图像。然而,IID问题在移动应用程序中普遍存在,并严重影响应用程序的性能。我们的研究目标包括:(1)分析Android应用程序中IID问题的特点是什么,(2)研究如何自动化地检测Android应用程序中的IID问题。方法 首先,本文构造了一个用来描述IID问题的描述框架。在描述框架中,每一个IID问题由四个部分来刻画:1)问题的触发条件,2)问题造成的后果,3)带有功能模块标注的图片处理代码切片,以及4)问题原因的描述。其次,本文从github、F_Droid和Google Play中收集Android应用程序和这些应用程序中的IID问题,并基于描述框架得到这些IID问题的带有功能模块标注的图片处理代码切片。第三,我们研究IID问题的带有功能模块标注的图片处理代码切片,以回答四个问题:●RQ1:IID问题的后果和触发条件是什么?●RQ2: 开发者在代码实现过程中是如何引入IID问题的?●RQ3:IID问题的常见运行时行为是什么?●RQ4:IID问题在代码实现上是否存在常见的反模式?第四,基于总结到的常见反模式,本文开发了一个低效图像显示问题静态检测工具TAPIR,对真实的Android应用程序进行检测。同时,为了分析TAPIR检测到的IID问题对性能的影响,我们分析了修复这些IID问题前后应用程序的性能。结果 针对资源解耦合数据中心,相比于传统云计算系统,新型资源解耦合云计算系统不但有效降低了云应用的性能波动,还将云应用性能加速达50%以上,尾延迟降低99%。结论 基于描述框架,我们对从243个流行的开源Android应用程序中收集的216个真实世界的IID问题进行了实证研究,本文发现:对于RQ1:大多数IID问题会导致应用程序崩溃(29.2%)或速度减慢(40.7%)。处理大量图像(55.0%)和大图像(45.0%)是触发IID问题的主要条件。Abstract: Mobile applications (apps for short) often need to display images. However, inefficient image displaying (IID) issues are pervasive in mobile apps, and can severely impact app performance and user experience. This paper first establishes a descriptive framework for the image displaying procedures of IID issues. Based on the descriptive framework, we conduct an empirical study of 216 real-world IID issues collected from 243 popular open-source Android apps to validate the presence and severity of IID issues, and then shed light on these issues’ characteristics to support research on effective issue detection. With the findings of this study, we propose a static IID issue detection tool TAPIR and evaluate it with 243 real-world Android apps. Encouragingly, 49 and 64 previously-unknown IID issues in two different versions of 16 apps reported by TAPIR are manually confirmed as true positives, respectively, and 16 previously-unknown IID issues reported by TAPIR have been confirmed by developers and 13 have been fixed. Then, we further evaluate the performance impact of these detected IID issues and the performance improvement if they are fixed. The results demonstrate that the IID issues detected by TAPIR indeed cause significant performance degradation, which further show the effectiveness and efficiency of TAPIR.