An Empirical Study on Quality of Android Applications written in Kotlin language
Context: During the last years, developers of mobile applications have the possibility to use new paradigms and tools for developing mobile applications. For instance, since 2017 Android developers have the official support to write Android applications using Kotlin language. Kotlin is programming language fully interoperable with Java that combines object-oriented and functional features. Objective: The goal of this paper is twofold. First, it aims to study the degree of adoption of Kotlin language on development of open-source Android applications and to measure the amount of Kotlin code inside Android applications. Secondly, it aims to measure the quality of Android applications that are written using Kotlin and to compare it with the quality of Android applications written using Java. Method: We first defined a method to detect Kotlin applications from a dataset of open-source Android applications. Then, we analyzed those applications to detect instances of code smells and computed an estimation of quality of the applications. Finally, we studied how the introduction of Kotlin code impacts on the quality of an Android application. Results: Our experiment found that 11.26% of applications from a dataset with 2,167 open-source applications have been written (partially or fully) using Kotlin language. We found that the introduction of Kotlin code increases the quality (in terms of presence of code smells) of the majority of the Android applications initially written in Java.
💡 Research Summary
The paper “An Empirical Study on Quality of Android Applications written in Kotlin” presents a large‑scale empirical investigation into two main aspects of Kotlin adoption in Android development: (1) the extent to which Kotlin is being used in open‑source Android projects, and (2) the impact of Kotlin code on the quality of those projects as measured by the presence of code smells.
Dataset Construction
The authors collected 2,167 Android applications from three public repositories—F‑Droid, AndroidTimeMachine, and AndroZoo. For each project they cloned the full Git history, parsed the source tree, and automatically identified Kotlin files (.kt) to determine whether a project contains any Kotlin code. This systematic detection pipeline allowed them to separate the corpus into “Kotlin” (partial or full) and “pure‑Java” groups.
Adoption Findings
Out of the total, 244 applications (11.26 %) contain Kotlin code. Among these, 82 apps (33.61 %) are written entirely in Kotlin, while the remaining 162 are hybrid projects that mix Java and Kotlin. This demonstrates that, despite official support since 2017, Kotlin’s market penetration in open‑source Android remains modest but growing.
Quality Measurement via Code Smells
Quality is operationalized using ten well‑known code smells identified in prior work by Hecht et al.: four object‑oriented smells (God Class, Feature Envy, Large Class, Data Class) and six Android‑specific smells (e.g., Leaking Context, No Low‑Memory Resolver). The authors employed the Paprika tool to detect these smells in every version (commit) of each application, thereby capturing both static snapshot data and temporal evolution.
Research Questions and Results
RQ1 – Adoption Rate: Confirmed the 11.26 % adoption figure, indicating an early‑stage diffusion of Kotlin.
RQ2 – Proportion of Kotlin Code: Found that a third of Kotlin‑using apps are pure Kotlin, while the rest retain a substantial Java footprint.
RQ3 – Evolution of Kotlin vs. Java Code: By measuring the line‑count of Kotlin and Java across commits, the study shows that in 63.9 % of hybrid projects the amount of Kotlin code increases over time while Java code correspondingly declines. This pattern suggests a gradual migration strategy rather than a sudden rewrite.
RQ4 – Code Smell Comparison: When comparing smell prevalence, three of the four object‑oriented smells appear slightly more often in Kotlin projects, but overall the median number of affected entities is higher in Java projects, and all Android‑specific smells are less frequent in Kotlin apps. Statistical tests confirm the significance of these differences.
RQ5 – Quality Impact of Introducing Kotlin: For projects originally written in Java, the introduction of Kotlin code leads to a reduction in code smells in at least 50 % of the cases. This improvement is especially pronounced in later versions, indicating that Kotlin’s language features (null‑safety, data classes, extension functions) may help developers write cleaner, less error‑prone code.
Threats to Validity
The authors discuss several limitations: (1) the dataset is limited to open‑source projects, which may not reflect commercial app practices; (2) Paprika’s detection accuracy, while high, is not perfect; (3) differences in project size and complexity could confound the observed smell frequencies.
Contributions
- A reproducible methodology for detecting Kotlin usage in Android repositories.
- A publicly available dataset of 244 Kotlin‑containing Android apps.
- Empirical evidence of Kotlin’s gradual increase in codebases over time.
- A comparative analysis of code smell prevalence between Kotlin and Java Android apps.
- Quantitative assessment of Kotlin’s positive impact on software quality.
Conclusion
Even though Kotlin currently accounts for a modest share of open‑source Android projects, the evidence suggests that its adoption is associated with a measurable reduction in code smells and an overall improvement in code quality. The findings support the view that incremental migration from Java to Kotlin can be a beneficial strategy for development teams seeking to enhance maintainability and reduce defect‑proneness. The authors recommend future work to (a) extend the analysis to larger, commercial codebases, (b) develop a Kotlin‑specific smell catalog, and (c) explore the relationship between smell reduction and other quality attributes such as performance and energy consumption.
Comments & Academic Discussion
Loading comments...
Leave a Comment