
PolyDroid: Learning-Driven Specialization of Mobile Applications Brian Heath Neelay Velingker University of Pennsylvania North Penn High School [email protected] [email protected] Osbert Bastani Mayur Naik University of Pennsylvania University of Pennsylvania [email protected] [email protected] ABSTRACT Thus, there is a pressing need for tools to help developers spe- The increasing prevalence of mobile apps has led to a prolifera- cialize their app based on resource usage preferences provided tion of resource usage scenarios in which they are deployed. This by the user. Existing tooling provides limited support for such motivates the need to specialize mobile apps based on diverse and specialization—for example, Android devices offer “battery saver” varying preferences of users. We propose a system, called Poly- and “data saver” modes that reduce battery usage and network Droid, for automatically specializing mobile apps based on user data usage, respectively, to allow users to dynamically configure preferences. The app developer provides a number of candidate con- apps based on their current preferences regarding resource usage. figurations, called reductions, that limit the resource usage ofthe However, beyond general rules enforced by the operating system original app. The key challenge underlying PolyDroid concerns (e.g., turning off background GPS usage), it is up to the developer learning the quality of user experience under different reductions. to determine how to specialize the app. That is, the developer must We propose an active learning technique that requires few user ex- manually specify how to modify the behavior of their app when periments to determine the optimal reduction for a given resource the user changes their resource usage preferences. usage specification. On a benchmark suite comprising 20 diverse, A key challenge in automatically specializing mobile apps is that open-source Android apps, we demonstrate that on average, Poly- different configuration options often affect user experience. For Droid obtains more than 85% of the optimal performance using example, one way to reduce network data usage is to reduce the just two user experiments. resolution of the images downloaded by an app. However, how the reduction in quality affects user experience depends heavily on the ACM Reference Format: context in which the image appears—e.g., reducing the quality of Brian Heath, Neelay Velingker, Osbert Bastani, and Mayur Naik. 2019. images of restaurant dishes in a food review app may render the app PolyDroid: Learning-Driven Specialization of Mobile Applications.In Pro- useless, whereas reducing the quality of background images in a ceedings of The 27th ACM Joint European Software Engineering Confer- weather app may have little or no impact on usability. Similarly, an ence and Symposium on the Foundations of Software Engineering (ESEC/FSE effective way to reduce CPU usage is to eliminate animations when 2019). ACM, New York, NY, USA, 11 pages. https://doi.org/10.1145/nnnnnnn. nnnnnnn transitioning between activities, but doing so may substantially reduce user experience. We propose a system, called PolyDroid, for automatically spe- 1 INTRODUCTION cializing mobile apps based on user preferences. To use PolyDroid, Mobile devices have given billions of users across the world access the developer simply provides a number of candidate configura- to web services, including many regions where access was previ- tions, called reductions, along with the original app, as well as a ously unavailable. A consequence of this success is that mobile app test script for each reduction that exercises the behaviors in that developers must cater to a huge range of devices, from expensive, reduction that differ from the original app. Reductions and test high-end devices that are nearly as powerful as more traditional scripts can also be automatically generated using program analy- arXiv:1902.09589v1 [cs.SE] 25 Feb 2019 computers, to inexpensive, low-end devices that have limited com- sis. Then, whenever a user desires to limit the resource usage of puting resources. Even a single user typically has widely varying the app, PolyDroid selects the reduction that optimizes a com- preferences—e.g., depending on whether they are at home or work, bination of (i) the resource usage of the reduction (depending on traveling, or have limited access to the cellular network. the user’s preferences), and (ii) the user’s experience of the reduc- tion. In particular, when using PolyDroid, the developer does not have to specify either the resource usage of different reductions, or Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed their impact on user experience (which is best dictated by the user). for profit or commercial advantage and that copies bear this notice and the full citation Thus, PolyDroid effectively separates the concern of optimizing on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, this tradeoff from the implementation of the mobile app. to post on servers or to redistribute to lists, requires prior specific permission and/or a To determine the resource usage of different reductions, Poly- fee. Request permissions from [email protected]. Droid runs each reduction in emulation and records its resource ESEC/FSE 2019, 26–30 August, 2019, Tallinn, Estonia © 2019 Association for Computing Machinery. ACM ISBN 978-x-xxxx-xxxx-x/YY/MM...$15.00 https://doi.org/10.1145/nnnnnnn.nnnnnnn ESEC/FSE 2019, 26–30 August, 2019, Tallinn, Estonia Brian Heath, Neelay Velingker, Osbert Bastani, and Mayur Naik original high quality medium quality low quality image removal Figure 1: A screenshot from the Android app “SkyTube” (left-most), together with screenshots from four candidate reductions. Reduction User Experience Score (1 - 9) % CPU Savings % Memory Savings % Network Data Savings original 9.0 0.0% 0.0% 0.0% high quality 7.4 0.0% 8.3% 72.0% medium quality 4.8 0.0% 17.0% 88.2% low quality 1.8 0.0% 22.4% 93.5% image removal 3.1 0.0% 33.2% 93.7% Table 1: User experience score and resource usage metrics for the original app and each candidate reduction shown in Figure 1. The user experience scores are averaged over 10 users. usage.1 The more challenging problem is measuring the quality • We have implemented our approach in a tool called PolyDroid of the user experience for different candidate reductions. In par- (Section 5) and show that it can compute good reductions using ticular, doing so requires running user experiments, which can be just a small number of user experiments (Section 6). expensive at large scale. The key contribution of PolyDroid is to leverage active learning to substantially reduce the number of user 2 MOTIVATING EXAMPLE experiments. PolyDroid uses an active learning strategy based on Suppose that Alice develops a new Android app for watching and the Thompson sampling algorithm [8, 14]. In addition, PolyDroid sharing videos, and wants it to be accessible to a wide variety uses historical data to estimate a Bayesian prior to guide sampling. of users. Using the current tools available, Alice must manually Using this strategy, PolyDroid can produce sensible results (e.g., specify how to modify her app to suit every different resource usage about 68% of optimal) even with zero experiments on the current specification that an end user provides. For example, suppose that app (i.e., based on data from other apps alone). Furthermore, run- Bob downloads Alice’s app. When Bob is traveling, he may want ning just two of the total possible user experiments (about 11 on to conserve network data usage, but he wants to continue to use average) is sufficient to get more than 85% of optimal performance. Alice’s app to keep track of the news. While the Android OS allows We have implemented PolyDroid for the Android platform Bob to specify this preference, Alice would have to implement and evaluate it using a benchmark suite comprising 20 diverse, program logic that encodes how to reduce network data usage. For open-source apps. We show that by leveraging active learning, example, Alice can reduce the quality of downloaded images. PolyDroid can compute good reductions based on very few user A key challenge is that Alice has to reason about how different experiments. Furthermore, we show how PolyDroid can be used modifications to her app affect the user experience of her app.For to personalize the choice of reduction by directly querying the end example, suppose that Alice has implemented the candidate modi- user (as opposed to, for instance, an online survey of hired users). fications to her app shown in Figure 1. We refer to each modified In summary, our work makes the following contributions: version of the app as a reduction. These reductions modify the orig- • We formulate the problem of determining the optimal reduction inal app by reducing the quality of images in the app by different for a user-provided resource usage specification (Section 3). degrees, or even removing the images altogether. For each of these • We provide an algorithm for computing the optimal reduction, candidate reductions, Alice has to understand whether the user as well as a variant that uses active learning to minimize the would be satisfied with the app, either through user experiments number of user experiments needed (Section 4). or based on her intuition. Then, Alice must combine her estimate of the user experience with every possible resource usage specifi- 1This strategy is reasonable since emulators for Android apps have very sophisticated tools for measuring resource usage; if desired, resource usage could be measured on cation that Bob may provide to decide which reduction to use in real devices as well.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages11 Page
-
File Size-