-
Automatizing Software Cognitive Complexity Reduction through Integer Linear Programming
Authors:
Rubén Saborido,
Javier Ferrer,
Francisco Chicano
Abstract:
Reducing the cognitive complexity of a piece of code to a given threshold is not trivial. Recently, we modeled software cognitive complexity reduction as an optimization problem and we proposed an approach to assist developers on this task. This approach enumerates sequences of code extraction refactoring operations until a stop** criterion is met. As a result, it returns the minimal sequence of…
▽ More
Reducing the cognitive complexity of a piece of code to a given threshold is not trivial. Recently, we modeled software cognitive complexity reduction as an optimization problem and we proposed an approach to assist developers on this task. This approach enumerates sequences of code extraction refactoring operations until a stop** criterion is met. As a result, it returns the minimal sequence of code extraction refactoring operations that is able to reduce the cognitive complexity of a code to the given threshold. However, exhaustive enumeration algorithms fail to scale with the code size. The number of refactoring plans can grow exponentially with the number of lines of code. In this paper, instead of enumerating sequences of code extraction refactoring operations, we model the cognitive complexity reduction as an Integer Linear Programming problem. This opens the door to the use of efficient solvers to find optimal solutions in large programs.
△ Less
Submitted 8 February, 2024;
originally announced February 2024.
-
MoMIT: Porting a JavaScript Interpreter on a Quarter Coin
Authors:
Rodrigo Morales,
Ruben Saborido,
Yann-Gaël Guéhéneuc
Abstract:
The Internet of Things (IoT) is a network of physical, heterogeneous, connected devices providing services through private networks and the Internet. It connects a range of new devices to the Internet so they can communicate with Web servers and other devices around the world. Today's standard platform for communicating Web pages and Web apps is JavaScript (JS) and extending the same standard plat…
▽ More
The Internet of Things (IoT) is a network of physical, heterogeneous, connected devices providing services through private networks and the Internet. It connects a range of new devices to the Internet so they can communicate with Web servers and other devices around the world. Today's standard platform for communicating Web pages and Web apps is JavaScript (JS) and extending the same standard platform to connect IoT devices seems more than appropriate. However, porting JS applications to the large variety of IoT devices, specifically on System-on-a-Chip (SoCs) devices (\eg~Arduino Uno, Particle \photon), is challenging because these devices are constrained in terms of memory and storage capacity. Running JS applications adds an overhead of resources to deploy a code interpreter on the devices. Also, running JS applications may not be possible ``as is'' on some device missing some hardware/software capabilities. To address this problem, we propose \momit~a multiobjective optimization approach to miniaturize JS applications to run on IoT constrained devices. To validate \momit, we miniaturize a JS interpreter to execute a testbed comprised of 23 applications and measure their performances before and after applying the miniaturization process. We implement \momit~using three different search algorithms and found that it can reduce code size, memory usage, and CPU time by median values of 31\%, 56\%, and 36\% respectively. Finally, MoMIT ported the miniaturized JS interpreters up to to 2 SoCs additional devices, in comparison of using default JS interpreter features.
△ Less
Submitted 25 May, 2019;
originally announced June 2019.
-
An App Performance Optimization Advisor for Mobile Device App Marketplaces
Authors:
Rubén Saborido,
Foutse Khomh,
Abram Hindle,
Enrique Alba
Abstract:
On mobile phones, users and developers use apps official marketplaces serving as repositories of apps. The Google Play Store and Apple Store are the official marketplaces of Android and Apple products which offer more than a million apps. Although both repositories offer description of apps, information concerning performance is not available. Due to the constrained hardware of mobile devices, use…
▽ More
On mobile phones, users and developers use apps official marketplaces serving as repositories of apps. The Google Play Store and Apple Store are the official marketplaces of Android and Apple products which offer more than a million apps. Although both repositories offer description of apps, information concerning performance is not available. Due to the constrained hardware of mobile devices, users and developers have to meticulously manage the resources available and they should be given access to performance information about apps. Even if this information was available, the selection of apps would still depend on user preferences and it would require a huge cognitive effort to make optimal decisions. Considering this fact we propose APOA, a recommendation system which can be implemented in any marketplace for hel** users and developers to compare apps in terms of performance.
APOA uses as input metric values of apps and a set of metrics to optimize. It solves an optimization problem and it generates optimal sets of apps for different user's context. We show how APOA works over an Android case study. Out of 140 apps, we define typical usage scenarios and we collect measurements of power, CPU, memory, and network usages to demonstrate the benefit of using APOA.
△ Less
Submitted 20 May, 2018; v1 submitted 13 September, 2017;
originally announced September 2017.
-
Comprehension of Ads-supported and Paid Android Applications: Are They Different?
Authors:
Rubén Saborido,
Foutse Khomh,
Yann-Gaël Guéhéneuc,
Giuliano Antoniol
Abstract:
The Android market is a place where developers offer paid and-or free apps to users. Free apps are interesting to users because they can try them immediately without incurring a monetary cost. However, free apps often have limited features and-or contain ads when compared to their paid counterparts. Thus, users may eventually need to pay to get additional features and-or remove ads. While paid app…
▽ More
The Android market is a place where developers offer paid and-or free apps to users. Free apps are interesting to users because they can try them immediately without incurring a monetary cost. However, free apps often have limited features and-or contain ads when compared to their paid counterparts. Thus, users may eventually need to pay to get additional features and-or remove ads. While paid apps have clear market values, their ads-supported versions are not entirely free because ads have an impact on performance.
In this paper, first, we perform an exploratory study about ads-supported and paid apps to understand their differences in terms of implementation and development process. We analyze 40 Android apps and we observe that (i) ads-supported apps are preferred by users although paid apps have a better rating, (ii) developers do not usually offer a paid app without a corresponding free version, (iii) ads-supported apps usually have more releases and are released more often than their corresponding paid versions, (iv) there is no a clear strategy about the way developers set prices of paid apps, (v) paid apps do not usually include more functionalities than their corresponding ads-supported versions, (vi) developers do not always remove ad networks in paid versions of their ads-supported apps, and (vii) paid apps require less permissions than ads-supported apps. Second, we carry out an experimental study to compare the performance of ads-supported and paid apps and we propose four equations to estimate the cost of ads-supported apps. We obtain that (i) ads-supported apps use more resources than their corresponding paid versions with statistically significant differences and (ii) paid apps could be considered a most cost-effective choice for users because their cost can be amortized in a short period of time, depending on their usage.
△ Less
Submitted 8 March, 2017;
originally announced March 2017.
-
Anti-patterns and the energy efficiency of Android applications
Authors:
Rodrigo Morales,
Ruben Saborido,
Foutse Khomh,
Francisco Chicano,
Giuliano Antoniol
Abstract:
The boom in mobile apps has changed the traditional landscape of software development by introducing new challenges due to the limited resources of mobile devices, e.g., memory, CPU, network bandwidth and battery. The energy consumption of mobile apps is nowadays a hot topic and researchers are actively investigating the role of coding practices on energy efficiency. Recent studies suggest that de…
▽ More
The boom in mobile apps has changed the traditional landscape of software development by introducing new challenges due to the limited resources of mobile devices, e.g., memory, CPU, network bandwidth and battery. The energy consumption of mobile apps is nowadays a hot topic and researchers are actively investigating the role of coding practices on energy efficiency. Recent studies suggest that design quality can conflict with energy efficiency. Therefore, it is important to take into account energy efficiency when evolving the design of a mobile app. The research community has proposed approaches to detect and remove anti-patterns (i.e., poor solutions to design and implementation problems) in software systems but, to the best of our knowledge, none of these approaches have included anti-patterns that are specific to mobile apps and--or considered the energy efficiency of apps. In this paper, we fill this gap in the literature by analyzing the impact of eight type of anti-patterns on a testbed of 59 android apps extracted from F-Droid. First, we (1) analyze the impact of anti-patterns in mobile apps with respect to energy efficiency; then (2) we study the impact of different types of anti-patterns on energy efficiency. We found that then energy consumption of apps containing anti-patterns and not (refactored apps) is statistically different. Moreover, we find that the impact of refactoring anti-patterns can be positive (7 type of anti-patterns) or negative (2 type of anti-patterns). Therefore, developers should consider the impact on energy efficiency of refactoring when applying maintenance activities.
△ Less
Submitted 19 October, 2016; v1 submitted 18 October, 2016;
originally announced October 2016.