Android applications (apps) are becoming complex software that must be developed quickly while continuously evolving to meet new user needs as well as regular updates. This rapid evolution may lead to poor implementation and design choices, known code smells. The presence of these smells within an application may degrade the quality and performance by complicating maintenance and evolution tasks. Thus, it is important to know these smells but also to detect and correct them, in order to allow developers to improve the quality and performance of their applications. Code refactoring is a key practice that is employed to ensure that the intent of a code change is properly achieved without compromising internal software quality.
While most of existing studies have investigated the impact of refactoring activities in desktop applications, little attention has been paid to mobile applications. In particular, there is a lack of knowledge about the impact of refactoring on different software quality aspects, including code smells and quality metrics. Moreover, most of previous research focused on studying the characteristics of traditional object-oriented (OO) code smells affecting source code files in desktop software systems, and advocated that the interaction and co-presence of code smells reduce the ability of developers to understand and maintain source code. However, little knowledge is available on emerging categories of Android-specific code smells and their interactions, i.e., co-occurrences, with traditional OO smells, in the context of Android apps.
Therefore, in this work we conduct a series of empirical studies to better understand the concept of refactoring and code smells in mobile apps. First, we conduct a longitudinal empirical study that analyses the evolution history of five open-source mobile apps to investigate the impact of refactoring on code smells. Then, we examined the prevalence of code smell co-occurrences and determine which code smell types tend to co-exist more frequently on a large dataset composed of 1,923 open-source mobile apps. Finally, we perform a study on a dataset composed of 300 open-source mobile apps to analyze the impact of refactoring on quality metrics.
Our results show that (1) code smells are widespread across Android applications, but smelly classes are not particularly targeted by refactoring activities and, when they are, it is rare for refactoring to actually remove a smell, (2) the co-occurrence phenomenon is indeed prevalent in Android apps and several smell types have strong associations, and (3) when refactoring affects the metrics it generally improves them. In many cases refactoring has no significant impact on the metrics, whereas one metric (LCOM) deteriorates overall as a result of refactoring.
The results of these studies revealed important research findings. In particular, on the current practice of refactoring and code smells in the context of mobile applications. These results allowed us to develop some recommendations for researchers and tool creators to design tools for detecting and refactoring mobile code smells. Our results opened perspectives for research works about the identification of code smells in mobile codes and development practices in general.
| Date | 17 Dec 2021 |
|---|
| Original language | American English |
|---|
| Awarding Institution | - École de technologie supérieure
|
|---|
| Supervisor | Ali Ouni (Supervisor) |
|---|
Hamdi, O. (Author),
Ouni (Supervisor),
17 Dec 2021Student thesis: Master's thesis › Master in Engineering: Engineering