Abstract
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 the development of open-source Android applications and to measure the amount of Kotlin code inside those 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 the 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 the presence of 10 different code smells studied, 4 object-oriented and 6 Android, of the majority of the Android applications initially written in Java.
Similar content being viewed by others
Notes
Last visit: 06/04/2018.
Last visit: 16/10/2018.
Experiment executed the June 4th, 2018.
AndroidTimeMachine resources: https://androidtimemachine.github.io/dataset/ and https://github.com/AndroidTimeMachine/open_source_android_apps
In the appendix we list that applications that suffer the mentioned problem: https://github.com/UPHF/kotlinandroid/blob/master/docs/wrong_match.md.
Version of Paprika used: commit 5ebd34 https://github.com/GeoffreyHecht/paprika/commit/5ebd349ed3067914386e8c6a05e87ff161f9edd1
https://developer.android.com/about/dashboards/ Last visit: 06/11/2018
Hecht (2016a) considers that a method is “long” (LM) if it has more than 17 instructions.
Applications classified as Kotlin: https://github.com/UPHF/kotlinandroid/blob/master/docs/final_kotlin_dataset.md
Classification of the evolution trends. https://github.com/UPHF/kotlinandroid/tree/master/docs/evolution
In our appendix we list the reason of those Parpika failures https://github.com/UPHF/kotlinandroid/blob/master/README.md#analyzing-apps-with-priprika
References
Allix K, Bissyandé TF, Klein J, Le Traon Y (2016) AndroZoo: Collecting Millions of Android Apps for the Research Community Kevin. Proceedings of the 13th International Workshop on Mining Software Repositories - MSR ’16, pp 468–471. https://doi.org/10.1145/2901739.2903508
AndroidDoc (2018a) Array map — android developers. https://developer.android.com/reference/android/support/v4/util/ArrayMap, [Online; accessed 17-July-2018]
AndroidDoc (2018b) Performance tips — android developers. https://developer.android.com/training/articles/perf-tips#PreferStatic, [Online; accessed 17-July-2018]
Aniche M, Bavota G, Treude C, Van Deursen A, Gerosa MA (2017) A validated set of smells in model-view-controller architectures. Proceedings - 2016 IEEE International Conference on Software Maintenance and Evolution, ICSME 2016, pp 233–243. https://doi.org/10.1109/ICSME.2016.12
Brown W H, Malveau R C, McCormick H W, Mowbray T J (1998) Antipatterns: refactoring software, architectures and projects in crisis, Wiley, New York
Carette A, Younes MAA, Hecht G, Moha N, Rouvoy R (2017) Investigating the energy impact of Android smells. SANER 2017 - 24th IEEE International Conference on Software Analysis, Evolution, and Reengineering, pp 115–126. https://doi.org/10.1109/SANER.2017.7884614
Chen TH, Shang W, Jiang ZM, Hassan AE, Nasser M, Flora P (2014) Detecting performance anti-patterns for applications developed using object-relational mapping. In: Proceedings of the 36th International Conference on Software Engineering, ACM, pp 1001–1012
Chidamber SR, Kemerer CF (1994) A metrics suite for object oriented design. IEEE Trans Softw Eng 20(6):476–493. https://doi.org/10.1109/32.295895
Cliff N (2014) Ordinal methods for behavioral data analysis. Psychology Press
Cruz L, Abreu R (2017) Performance-Based Guidelines for Energy Efficient Mobile Applications. 2017 IEEE/ACM 4th International Conference on Mobile Software Engineering and Systems (MOBILESoft), pp 46–57, https://doi.org/10.1109/MOBILESoft.2017.19, http://ieeexplore.ieee.org/document/7972717/
Cruz L, Abreu R (2018) Using Automatic Refactoring to Improve Energy Efficiency of Android Apps. In: Proceedings of the CIbSE XXI Ibero-American Conference on Software Engineering. arXiv:1803.05889
Fowler M, Beck K, Brant J, Opdyke W, Roberts D (1999) Refactoring: improving the design of existing code. Addison-Wesley Professional
Geiger FX, Malavolta I (2018a) Datasets of Android Applications: a Literature Review. arXiv:1809.10069
Geiger FX, Malavolta I, Pascarella L, Palomba F, Di Nucci D, Bacchelli A (2018b) A graph-based dataset of commit history of real-world android apps. In: Proceedings of the 15th International Conference on Mining Software Repositories, MSR ’18. ACM, New York, pp 30–33. https://doi.org/10.1145/3196398.3196460
Grano G, Di Sorbo A, Mercaldo F, Visaggio CA, Canfora G, Panichella S (2017) Android apps and user feedback: a dataset for software evolution and quality improvement. Proceedings of the 2nd ACM SIGSOFT International Workshop on App Market Analytics - WAMA 2017, pp 8–11. https://doi.org/10.1145/3121264.3121266, http://dl.acm.org/citation.cfm?doid=3121264.3121266
Haase C (2015) Developing for android ii – google developers – medium. https://medium.com/google-developers/developing-for-android-ii-bb9a51f8c8b9, [Online; accessed 17-July-2018]
Habchi S, Hecht G, Rouvoy R, Moha N (2017) Code Smells In iOS Apps: How Do They Compare to Android? Proceedings - 2017 IEEE/ACM 4th International Conference on Mobile Software Engineering and Systems, MOBILESoft 2017, pp 110–121. https://doi.org/10.1109/MOBILESoft.2017.11
Hecht G, Benomar O, Rouvoy R, Moha N, Duchien L (2015a) Tracking the software quality of android applications along their evolution. In: Proceedings of the 2015 30th IEEE/ACM International Conference on Automated Software Engineering (ASE), ASE ’15. IEEE Computer Society, Washington, pp 236–247. https://doi.org/10.1109/ASE.2015.46
Hecht G, Rouvoy R, Moha N, Duchien L (2015b) Detecting Antipatterns in Android Apps. Proceedings - 2nd ACM International Conference on Mobile Software Engineering and Systems, MOBILESoft 2015, pp 148–149. https://doi.org/10.1109/MobileSoft.2015.38
Hecht G (2016a) Detection and analysis of impact of code smells in mobile applications. Phd thesis, Université Lille 1 : Sciences et Technologies ; Université du Québec à Montréal. https://tel.archives-ouvertes.fr/tel-01418158
Hecht G, Moha N, Rouvoy R (2016b) An empirical study of the performance impacts of Android code smells. Proceedings of the International Workshop on Mobile Software Engineering and Systems - MOBILESoft ’16 pp 59–69, https://doi.org/10.1145/2897073.2897100, http://dl.acm.org/citation.cfm?doid=2897073.2897100, arXiv:1508.06655v1
IDC (2017) Smartphone os market share, 2017 q1. https://www.idc.com/promo/smartphone-market-share/
Kessentini M, Ouni A (2017) Detecting android smells using Multi-Objective genetic programming. Proceedings - 2017 IEEE/ACM 4th International Conference on Mobile Software Engineering and Systems, MOBILESoft 2017, pp 122–132. https://doi.org/10.1109/MOBILESoft.2017.29
Khalid H, Nagappan M, Hassan AE (2016) Examining the relationship between FindBugs warnings and app ratings. IEEE Softw 33(4):34–39. https://doi.org/10.1109/MS.2015.29
KotlinDoc (2018) Classes and inheritance - kotlin programming language. https://kotlinlang.org/docs/reference/classes.html#companion-objects, [Online; accessed 17-July-2018]
La J (2017) Update on kotlin for android. https://android-developers.googleblog.com/2017/11/update-on-kotlin-for-android.html
Lehman M M (1980) Programs, life cycles, and laws of software evolution. Proc IEEE 68(9):1060–1076
Li D, Guo B, Shen Y, Li J, Huang Y (2017a) The evolution of open-source mobile applications: An empirical study. J Softw Evol Process 29(7):1–18. https://doi.org/10.1002/smr.1855
Li L, Bissyand T F, Papadakis M, Rasthofer S, Bartel A, Octeau D, Klein J, Traon L (2017b) Static analysis of android apps: a systematic literature review. Inf Softw Technol 88(C):67–95. https://doi.org/10.1016/j.infsof.2017.04.001
Lockwood A (2013) How to leak a context: Handlers & inner classes. https://www.androiddesignpatterns.com/2013/01/inner-class-handler-memory-leak.html, [Online; accessed 17-July-2018]
Macbeth G, Razumiejczyk E, Ledesma RaD (2011) Cliff’s Delta Calculator: A non-parametric effect size program for two groups of observations. Universitas Psychologica 10:545 – 555, http://www.scielo.org.co/scielo.php?script=sci_arttext&pid=S1657-92672011000200018&nrm=iso
Malavolta I, Ruberto S, Soru T, Terragni V (2015a) End users’ perception of hybrid mobile apps in the google play store. In: 2015 IEEE International Conference on Mobile Services, pp 25–32. https://doi.org/10.1109/MobServ.2015.14
Malavolta I, Ruberto S, Soru T, Terragni V (2015b) Hybrid mobile apps in the google play store: An exploratory investigation. In: Proceedings of the Second ACM International Conference on Mobile Software Engineering and Systems, MOBILESoft ’15. IEEE Press, Piscataway, pp 56–59. http://dl.acm.org/citation.cfm?id=2825041.2825051
Mannan UA, Ahmed I, Almurshed RAM, Dig D, Jensen C (2016) Understanding code smells in Android applications. International Workshop on Mobile Software Engineering and Systems (MOBILESoft ’16), pp 225–234. https://doi.org/10.1145/2897073.2897094, http://dl.acm.org/citation.cfm?doid=2897073.2897094
Mariotti G (2013a) Antipattern: freezing a ui with broadcast receiver. http://gmariotti.blogspot.com/2013/02/antipattern-freezing-ui-with-broadcast.html, [Online; accessed 17-July-2018]
Mariotti G (2013b) Antipattern: freezing the ui with a service and an intentservice. http://gmariotti.blogspot.com/2013/03/antipattern-freezing-ui-with-service.html, [Online; accessed 17-July-2018]
Mariotti G (2013c) Antipattern: freezing the ui with an asynctask. http://gmariotti.blogspot.com/2013/02/antipattern-freezing-ui-with-asynctask.html, [Online; accessed 17-July-2018]
Martinez M, Lecomte S (2017) Towards the quality improvement of cross-platform mobile applications. In: Proceedings of the 4th International Conference on Mobile Software Engineering and Systems, MOBILESoft ’17. IEEE Press, Piscataway, pp 184–188. https://doi.org/10.1109/MOBILESoft.2017.30
Mazinanian D, Tsantalis N, Mesbah A (2014) Discovering refactoring opportunities in cascading style sheets. In: Proceedings of the 22nd ACM SIGSOFT International Symposium on Foundations of Software Engineering. ACM, pp 496–506
McAnlis C (2015) Android performance patterns: Overdraw, cliprect, quickreject. https://www.youtube.com/watch?v=vkTn3Ule4Ps, [Online; accessed 17-July-2018]
McCabe T J (1976) A complexity measure. IEEE Trans Softw Eng 2(4):308–320
Morales R, Saborido R, Khomh F, Chicano F, Antoniol G (2016) Anti-patterns and the energy efficiency of Android applications. arXiv:1610.05711
Morales R, Saborido R, Khomh F, Chicano F, Antoniol G (2017) EARMO: An Energy-Aware Refactoring Approach for Mobile Apps. IEEE Trans Softw Eng X(X):1–31. https://doi.org/10.1109/TSE.2017.2757486
Nagappan M, Shihab E (2016) Future Trends in Software Engineering Research for Mobile Apps. 2016 IEEE 23rd International Conference on Software Analysis, Evolution, and Reengineering (SANER), pp 21–32. https://doi.org/10.1109/SANER.2016.88, http://ieeexplore.ieee.org/document/7476770/
Ni-Lewis I (2015a) Avoiding allocations in ondraw() (100 days of google dev). https://www.youtube.com/watch?v=HAK5acHQ53E, [Online; accessed 17-July-2018]
Ni-Lewis I (2015b) Custom views and performance (100 days of google dev). https://youtu.be/zK2i7ivzK7M?t=4m57s, [Online; accessed 17-July-2018]
Palomba F, Bavota G, Di Penta M, Oliveto R, Poshyvanyk D, De Lucia A (2015) Mining version histories for detecting code smells. IEEE Trans. Softw. Eng. 41(5):462–489. https://doi.org/10.1109/TSE.2014.2372760
Palomba F, Di Nucci D, Panichella A, Zaidman A, De Lucia A (2017) Lightweight detection of Android-specific code smells: The aDoctor project. SANER 2017 - 24th IEEE International Conference on Software Analysis, Evolution, and Reengineering, pp 487–491. https://doi.org/10.1109/SANER.2017.7884659, https://dibt.unimol.it/staff/fpalomba/documents/C18.pdf
Palomba F, Bavota G, Penta MD, Fasano F, Oliveto R, Lucia AD (2018) On the diffuseness and the impact on maintainability of code smells: a large scale empirical investigation. Empir Softw Eng 23(3):1188–1221. https://doi.org/10.1007/s10664-017-9535-z
Reimann J, Brylski M, Aßmann U (2014a) Android smells catalogue. http://www.modelrefactoring.org/smell_catalog, [Online; accessed 17-July-2018]
Reimann J, Brylski M, Aßmann U (2014b) A tool-supported quality smell catalogue for android developers. In: Proceedings of the conference modellierung 2014 in the workshop modellbasierte und modellgetriebene softwaremodernisierung–MMSM, vol 2014
Romano J, Kromrey JD, Coraggio J, Skowronek J, Devine L (2006) Exploring methods for evaluating group differences on the nsse and other surveys: Are the t-test and cohen’sd indices the most appropriate choices. In: annual meeting of the Southern Association for Institutional Research, Citeseer
Saborido R, Morales R, Khomh F, Guéhéneuc YG, Antoniol G (2018) Getting the most from map data structures in Android. Empirical Software Engineering, pp 1–36. https://doi.org/10.1007/s10664-018-9607-8
Sharma T, Spinellis D (2018) A survey on software smells. J Syst Softw 138:158–173. https://doi.org/10.1016/j.jss.2017.12.034
Tufano M, Palomba F, Bavota G, Oliveto R, Di Penta M, De Lucia A, Poshyvanyk D (2015) When and why your code starts to smell bad. In: Proceedings of the 37th International Conference on Software Engineering - Volume 1, ICSE ’15. IEEE Press, Piscataway, pp 403–414. http://dl.acm.org/citation.cfm?id=2818754.2818805
Verloop D (2013) Code smells in the mobile applications domain. Master thesis, TU Delft, Delft University of Technology, https://repository.tudelft.nl/islandora/object/uuid:bcba7e5b-e898-4e59-b636-234ad3fdc432?collection=education
Vinther M (2017) Why you should totally switch to kotlin. https://medium.com/@magnus.chatt/why-you-should-totally-switch-to-kotlin-c7bbde9e10d5
Zadeh LA (1974) Fuzzy logic and its application to approximate reasoning. In: IFIP Congress, vol 591
Author information
Authors and Affiliations
Corresponding author
Additional information
Communicated by: David Lo, Meiyappan Nagappan, Fabio Palomba, and Sebastiano Panichella
Publisher’s note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Rights and permissions
About this article
Cite this article
Góis Mateus, B., Martinez, M. An empirical study on quality of Android applications written in Kotlin language. Empir Software Eng 24, 3356–3393 (2019). https://doi.org/10.1007/s10664-019-09727-4
Published:
Issue Date:
DOI: https://doi.org/10.1007/s10664-019-09727-4