WSO2Con2024 - Software Delivery in Hybrid Environments
Characterizing the transition to Kotlin of Android Apps: A Study on F-Droid, Play Store, and GitHub
1. Characterizing the transition to Kotlin
of Android Apps: A Study on F-Droid,
Play Store, and GitHub
Luca Ardito, Riccardo Coppola, Marco Torchiano
Politecnico di Torino, Dipartimento di Automatica e Informatica
3rd International Workshop on App Market Analytics
2. A brief history of Kotlin
2011: Kotlin appears as a new programming language;
February 2016: first stable release of Kotlin language;
May 2017: Kotlin becomes a first-class language on Android;
October 2017: release 3.0 of Android Studio IDE provides
native support to Kotlin.
May 2019: Kotlin becomes default language for Android programming.
3. Why migrate to Kotlin?
Kotlin is described as safer and more concise alternative to Java;
Kotlin helps avoid several common Java programming pitfalls;
Kotlin can seamlessly coexist with Java.
4. Investigate the diffusion and evolution of Kotlin code on open-
source projects hosted on popular app repositories.
Study Goal
5. RQ1 – Diffusion: What is the adoption of Kotlin on Android
apps available on F-Droid?
RQ2 – Evolution: How have projects on F-Droid evolved from
Java to Kotlin?
RQ3 – Popularity: Does the development with Kotlin have an
influence on the success of released apps?
Study Design – Research Questions
6. KRL (Kotlin Relative LOCs): number of Kotlin LOCs over the total amount of
production LOCs of the project;
KRF (Kotlin Relative Files): number of Kotlin .kt files over the total amount
of production code files (.kt + .java files);
KFPR (Kotlin-Featuring Projects Ratio): ratio of projects of a set featuring at
least a Kotlin .kt file;
KMPR (Kotlin-Majority Projects Ratio): ratio of projects of a set featuring a
majority of Kotlin LOCs in production code.
Study Design – Diffusion Metrics
7. KNR (No-Kotlin Relative Releases): ratio of tagged releases without Kotlin
code;
KAR (Kotlin-Adoption Relative Releases): ratio of tagged releases that
featured less than 50% kotlin code;
KMR (Kotlin-Majority Relative Releases): ratio of tagged releases that
featured a majority of Kotlin LOCs;
KOR (Kotlin-Only Relative Releases): ratio of tagged releases that featured
only Kotlin code.
Study Design – Evolution Metrics
8. Study Design – Selected Popularity Metrics
Average rating
Number of downloads
Number of stars
9. 1. Mining of packages from F-Droid
All F-Droid projects downloaded by Using Selenium with Chromedriver.
All available information (e.g., last version, last update) collected.
Study Design – Research Method
10. 2. Static analysis of F-Droid packages
Analysis with bash scripts to find Kotlin files in source code folders, and
compute the Diffusion metrics.
Study Design – Research Method
11. 3. Mining of app info from the Google Play Store
Search on the PlayStore for packages corresponding to those hosted on
F-Droid.
Extraction of relevant information for each package, e.g. number of
downloads, average rating, date of last update.
Check for correlations between popularity metrics and quantity of Kotlin
code.
Study Design – Research Method
12. 4. GitHub analysis and mining
Search for associations between the projects hosted on F-Droid and
repositories hosted on GitHub;
Manual check in case of multiple repositories with same name,
Scraping of popularity metrics and check of correlations with the amount of
Kotlin code in the repositories.
Study Design – Research Method
13. 5. Static analysis of GitHub Repositories
All repositories are cloned after the filtering phase;
Evolution of the repositories is studied, at release granularity.
Study Design – Research Method
15. Repository restricted to projects updated on F-Droid or GitHub after
October 2017;
Computation of Diffusion metrics on the most recently updated app
package (RQ1);
Analysis of «abandoned» projects (45-days threshold);
Analysis of projects not abandoned on GitHub to compute Evolution
metrics (RQ2);
Analysis of not abandoned projects to search correlation between Kotlin
adoption and popularity metrics (RQ3).
Study Design – Analysis Method
22. Results - Popularity
(c) Number of Stars of the GitHub project (statistically significant correlation w.
presence of Kotlin code)
23. Conclusions
Many open-source apps are nowadays written with Kotlin;
Leaders of open source projects interested in migrating their applications to
Kotlin, should know that – when adopted – the language appears to be
preferred to Java;
When considering the alternatives among staying with Java, using Kotlin only
in part, or using mostly Kotlin, no significant impact was observed on user’s
appreciation of the app.
24. Next Steps
Analysis of all Android repositories on GitHub;
Analysis of programming patterns adopted by developers using Kotlin;
Inspection of Kotlin apps regarding vulnerabilities, defects and testing
procedures;
Sentiment analysis of textual reviews of apps as additional popularity index;
Actionable guidelines to developers for better development with the Kotlin
language.