Here you can find more information about our study reliazed in our paper On the adoption, usage and evolution of Kotlin Features on Android development
Background: Google announced Kotlin as an Android official programming language in 2017, giving developers an option of writing applications using a language that combines object-oriented and functional features.
Aims: The goal of this work is to understand the usage of Kotlin features considering four aspects: i) which features are adopted, ii) what is the degree of adoption, iii) when are these features added into Android applications for the first time, and iv) how the usage of features evolves along with applications' evolution.
Method: Exploring the source code of 387 Android applications, we identify the usage of Kotlin features on each version application's version and compute the moment that each feature is used for the first time.
Finally, we identify the evolution trend that better describes the usage of these features.
Results: 5 out of 26 features are used on at least 50% of applications. Moreover, we found that type inference, lambda and safe call are the most used features. Also, we observed that the most used Kotlin features are those first included on Android applications. Finally, we report that the majority of applications tend to add more instances of 24 out of 26 features along with their evolution.
Conclusions: Our study generates 7 main findings. We present their implications, which are addressed to developers, researchers and tool builders in order to foster the use of Kotlin features to develop Android applications.
Response to RQ 1: We studied 26 Kotlin features in our experiment, and as a result, we found that all features are used. Furthermore, we identified three groups of features: We studied 19 Kotlin features in our experiment, and as a result, we found three groups of features: i) 7 features used in at least 80% of applications; ii) 9 features used in more than 48% and less than 80% of applications; iii) 10 features used in less than 33%.
Furthermore, we found that type inference, lambdas and safe calls are the most used features, being found on 98%, 95% and 89% of applications, respectively.
Percentage of applications that uses a specific Kotlin feature. Each bar corresponds to a feature and contains in the top the number of applications that use that feature.
Distribution of the number of instances of the studied features in FAMAZOA's applications.
Kotlin features normalized. The first box (right) shows the distribution of the number of extension functions divided by the number of functions.
Response to RQ 3: Developers tend to more instances along the evolution of Android applications of 18 out of 19 (94%) features studied. The only exception is the feature Unsafe call that was better described by the instability trend. Moreover, we found that 9 out of 19 features are better described by the trend Constant rise.
Distribution of the coefficient of determination, R-square, considering the best function fitted for each feature. The median value is 0.88 (R-square equal to 1 means a perfect fitting).
Analyzed data result grouped by: