Nothing Special   »   [go: up one dir, main page]

skip to main content
10.1145/3267183.3267186acmotherconferencesArticle/Chapter ViewAbstractPublication PagessbcarsConference Proceedingsconference-collections
research-article

Are you still smelling it?: A comparative study between Java and Kotlin language

Published: 17 September 2018 Publication History

Abstract

Java is one of the most widely used programming languages. However, Java is a verbose language, thus one of the main drawbacks of the language is that even simple tasks often entail writing a significant amount of code. In some cases, writing too much code might lead to certain code smells, which are violations of fundamental design that can negatively impact the overall quality of programs. To allow programmers to write concise code, JetBrains created a new language named Kotlin. Nevertheless, few studies have evaluated whether Kotlin leads to concise and clearer code in comparison to Java. We conjecture that due to Java's verbosity, programs written in Java are likely to have more code smells than Kotlin programs. Therefore, we set out to evaluate whether some types of code smells are more common in Java programs. To this end, we carried out a large-scale empirical study involving more than 6 million lines of code from programs available in 100 repositories. We found that on average Kotlin programs have less code smells than Java programs.

References

[1]
Luis Cruz, Rui Abreu, and Jean-Noël Rouvignac. 2017. Leafactor: Improving Energy Efficiency of Android Apps via Automatic Refactoring. In 4th International Conference on Mobile Software Engineering and Systems (MOBILESoft). 205--206.
[2]
Francesca Arcelli Fontana, Pietro Braione, and Marco Zanoni. 2012. Automatic detection of bad smells in code: An experimental assessment. Journal of Object Technology 11, 2 (2012), 5--10.
[3]
Francesca Arcelli Fontana, Marco Zanoni, Alessandro Marino, and Mika V. Mäntylä. 2013. Code Smell Detection: Towards a Machine Learning-Based Approach. In 29th International Conference on Software Maintenance (ICSM). 396--399.
[4]
Martin Fowler, Kent Beck, John Brant, William Opdyke, and Don Roberts. 1999. Refactoring: Improving the Design of Existing Code. Addison-Wesley.
[5]
Shizhe Fu and Beijun Shen. 2015. Code Bad Smell Detection through Evolutionary Data Mining. In 9th International Symposium on Empirical Software Engineering and Measurement (ESEM). 1--9.
[6]
Ray Hyman. 1982. Quasi-Experimentation: Design and Analysis Issues for Field Settings. Journal of Personality Assessment 46, 1 (1982), 96--97.
[7]
Fehmi Jaafar, Yann-Gaël Guéhéneuc, Sylvie Hamel, and Foutse Khomh. 2013. Mining the relationship between anti-patterns dependencies and fault-proneness. In 20th Working Conference on Reverse Engineering (WCRE). 351--360.
[8]
Eirini Kalliamvakou, Georgios Gousios, Kelly Blincoe, Leif Singer, Daniel M. German, and Daniela Damian. 2014. The Promises and Perils of Mining GitHub. In 11th Working Conference on Mining Software Repositories (MSR). 92--101.
[9]
Amandeep Kaur, Sushma Jain, and Shivani Goel. 2017. A Support Vector Machine Based Approach for Code Smell Detection. In International Conference on Machine Learning and Data Science (MLDS). 9--14.
[10]
P V Kulkarni and Mayur K Jadhav. 2018. Exploring Kotlin's Enhancements for multiplatform projects. International Education and Research Journal 4, 3 (2018).
[11]
Michele Lanza, Radu Marinescu, and Stéphane Ducasse. 2005. Object-Oriented Metrics in Practice. Secaucus.
[12]
Jörg Lenhard, Martin Blom, and Sebastian Herold. 2018. Exploring the suitability of source code metrics for indicating architectural inconsistencies. Software Quality Journal (March 2018), online.
[13]
Pranita Maldikar, San-Hong Li, and Kingsum Chow. 2016. Java Performance Mysteries. ITM Web of Conferences 7 (2016), 09015.
[14]
Radu Marinescu. 2004. Detection strategies: metrics-based rules for detecting design flaws. In 20th International Conference on Software Maintenance (ICSE). 350--359.
[15]
B. M. Merzah and Y. E. Selçuk. 2017. Metric based detection of refused bequest code smell. In 9th International Conference on Computational Intelligence and Communication Networks (CICN). 53--57.
[16]
Matthew James Munro. 2005. Product metrics for automatic identification of "bad smell" design problems in java source-code. In Software Metrics, 2005. 11th IEEE International Symposium. IEEE, 15--15.
[17]
M J Munro. 2005. Product Metrics for Automatic Identification of "Bad Smell" Design Problems in Java Source-Code. In 11th International Software Metrics Symposium (METRICS). 15--15.
[18]
D. Di Nucci, F. Palomba, D. A. Tamburri, A. Serebrenik, and A. De Lucia. 2018. Detecting code smells using machine learning techniques: Are we there yet?. In 25th International Conference on Software Analysis, Evolution and Reengineering (SANER). 612--621.
[19]
Thanis Paiva, Amanda Damasceno, Eduardo Figueiredo, and Cláudio Sant'Anna. 2017. On the evaluation of code smells and detection tools. Journal of Software Engineering Research and Development 5, 1 (2017), 7.
[20]
Fabio Palomba, Gabriele Bavota, Massimiliano Di Penta, Rocco Oliveto, and Andrea De Lucia. 2014. Do they really smell bad? a study on developers' perception of bad code smells. In 30th international conference on Software maintenance and evolution (ICSME). 101--110.
[21]
Fabio Palomba, Gabriele Bavota, Massimiliano Di Penta, Rocco Oliveto, Andrea De Lucia, and Denys Poshyvanyk. 2013. Detecting Bad Smells in Source Code Using Change History Information. In 28th International Conference on Automated Software Engineering. 268--278.
[22]
Fabio Palomba, Gabriele Bavota, Massimiliano Di Penta, Fausto Fasano, Rocco Oliveto, and Andrea De Lucia. 2018. On the diffuseness and the impact on maintainability of code smells: a large scale empirical investigation. Empirical Software Engineering 23, 3 (2018), 1188--1221.
[23]
F. Palomba, G. Bavota, M. D. Penta, R. Oliveto, D. Poshyvanyk, and A. De Lucia. 2015. Mining Version Histories for Detecting Code Smells. IEEE Transactions on Software Engineering 41, 5 (May 2015), 462--489.
[24]
F. Palomba, A. Panichella, A. De Lucia, R. Oliveto, and A. Zaidman. 2016. A textual-based technique for Smell Detection. In 24th International Conference on Program Comprehension (ICPC). 1--10.
[25]
R Peters and A Zaidman. 2012. Evaluating the Lifespan of Code Smells using Software Repository Mining. In 16th European Conference on Software Maintenance and Reengineering (CSMR). 411--416.
[26]
K Siva Prasad Reddy. 2017. Spring Boot with Groovy, Scala, and Kotlin. In Beginning Spring Boot 2: Applications and Microservices with the Spring Framework. Apress, Berkeley, 259--278.
[27]
Ghulam Rasool and Zeeshan Arshad. 2015. A review of code smell mining techniques: Code Smell Mining Techniques. Journal of Software: Evolution and Process 27, 11 (2015), 867--895.
[28]
Patrik Schwermer. 2018. Performance Evaluation of Kotlin and Java on Android Runtime.
[29]
Tushar Sharma and Diomidis Spinellis. 2018. A survey on software smells. Journal of Systems and Software 138 (2018), 158--173.
[30]
Ashish Sureka. 2016. Parichayana: An Eclipse Plugin for Detecting Exception Handling Anti-Patterns and Code Smells in Java Programs. (Dec. 2016). arXiv:cs.SE/1701.00108
[31]
N. Tsantalis, T. Chaikalis, and A. Chatzigeorgiou. 2008. JDeodorant: Identification and Removal of Type-Checking Bad Smells. In 12th European Conference on Software Maintenance and Reengineering (CSMR). 329--331.
[32]
N. Tsantalis, T. Chaikalis, and A. Chatzigeorgiou. 2018. Ten years of JDeodorant: Lessons learned from the hunt for smells. In 25th International Conference on Software Analysis, Evolution and Reengineering (SANER). 4--14.
[33]
Nikolaos Tsantalis and Alexander Chatzigeorgiou. 2009. Identification of move method refactoring opportunities. IEEE Transactions on Software Engineering 35, 3 (2009), 347--367.
[34]
Michele Tufano, Fabio Palomba, Gabriele Bavota, Rocco Oliveto, Massimiliano Di Penta, Andrea De Lucia, and Denys Poshyvanyk. 2017. When and why your code starts to smell bad (and whether the smells go away). IEEE Transactions on Software Engineering 43, 11 (2017), 1063--1088.
[35]
M Tufano, F Palomba, G Bavota, R Oliveto, M D Penta, A De Lucia, and D Poshyvanyk. 2017. When and Why Your Code Starts to Smell Bad (and Whether the Smells Go Away). IEEE Transactions on Software Engineering 43, 11 (2017), 1063--1088.
[36]
E van Emden and L Moonen. 2002. Java quality assurance by detecting code smells. In 9th Working Conference on Reverse Engineering (WCRE). 97--106.
[37]
Bartosz Walter and Tarek Alkhaeir. 2016. The relationship between design patterns and code smells: An exploratory study. Information and Software Technology 74 (2016), 127--142.
[38]
C. Wohlin, P. Runeson, M. Höst, M. C. Ohlsson, B. Regnell, and A. Wesslén. 2012. Experimentation in Software Engineering. Springer. 236 pages.
[39]
Aiko Yamashita. 2014. Assessing the capability of code smells to explain maintenance problems: an empirical study combining quantitative and qualitative data. Empirical Software Engineering 19, 4 (2014), 1111--1143.
[40]
Aiko Yamashita and Steve Counsell. 2013. Code smells as system-level indicators of maintainability: An empirical study. Journal of System and Software 86, 10 (2013), 2639--2653.
[41]
Aiko Yamashita and Leon Moonen. 2013. Exploring the impact of inter-smell relations on software maintainability: An empirical study. In 35th International Conference on Software Engineering (ICSE). 682--691.
[42]
Aiko Yamashita and Leon Moonen. 2013. To what extent can maintenance problems be predicted by code smell detection? -- An empirical study. Information and Software Technology 55, 12 (2013), 2223--2242.

Cited By

View all
  • (2025)Kotlin assimilating the Android ecosystem: An appraisal of diffusion and impact on maintainabilityJournal of Systems and Software10.1016/j.jss.2025.112346222(112346)Online publication date: Apr-2025
  • (2024)Cross-Language Dependencies: An Empirical Study of Kotlin-JavaProceedings of the 18th ACM/IEEE International Symposium on Empirical Software Engineering and Measurement10.1145/3674805.3686680(189-199)Online publication date: 24-Oct-2024
  • (2024)Accessibility of Mobile User Interfaces using Flutter and React Native2024 IEEE 21st Consumer Communications & Networking Conference (CCNC)10.1109/CCNC51664.2024.10454681(1-6)Online publication date: 6-Jan-2024
  • Show More Cited By

Index Terms

  1. Are you still smelling it?: A comparative study between Java and Kotlin language

    Recommendations

    Comments

    Please enable JavaScript to view thecomments powered by Disqus.

    Information & Contributors

    Information

    Published In

    cover image ACM Other conferences
    SBCARS '18: Proceedings of the VII Brazilian Symposium on Software Components, Architectures, and Reuse
    September 2018
    123 pages
    ISBN:9781450365543
    DOI:10.1145/3267183
    • Program Chair:
    • Ingrid Nunes
    Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

    In-Cooperation

    • SBC: Brazilian Computer Society
    • UFSCar: Federal University of São Carlos
    • IFSP: Federal Institute of São Paulo

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    Published: 17 September 2018

    Permissions

    Request permissions for this article.

    Check for updates

    Author Tags

    1. Bad Smell
    2. Code Smell
    3. Kotlin Language
    4. refactoring

    Qualifiers

    • Research-article
    • Research
    • Refereed limited

    Conference

    SBCARS '18

    Acceptance Rates

    SBCARS '18 Paper Acceptance Rate 11 of 40 submissions, 28%;
    Overall Acceptance Rate 23 of 79 submissions, 29%

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

    • Downloads (Last 12 months)73
    • Downloads (Last 6 weeks)5
    Reflects downloads up to 18 Feb 2025

    Other Metrics

    Citations

    Cited By

    View all
    • (2025)Kotlin assimilating the Android ecosystem: An appraisal of diffusion and impact on maintainabilityJournal of Systems and Software10.1016/j.jss.2025.112346222(112346)Online publication date: Apr-2025
    • (2024)Cross-Language Dependencies: An Empirical Study of Kotlin-JavaProceedings of the 18th ACM/IEEE International Symposium on Empirical Software Engineering and Measurement10.1145/3674805.3686680(189-199)Online publication date: 24-Oct-2024
    • (2024)Accessibility of Mobile User Interfaces using Flutter and React Native2024 IEEE 21st Consumer Communications & Networking Conference (CCNC)10.1109/CCNC51664.2024.10454681(1-6)Online publication date: 6-Jan-2024
    • (2024)Android Source Code Smells: A Systematic Literature ReviewSoftware: Practice and Experience10.1002/spe.3401Online publication date: 27-Dec-2024
    • (2023)Comparing the understandability of iteration mechanisms over Collections in JavaFoundations of Computing and Decision Sciences10.2478/fcds-2023-000248:1(19-37)Online publication date: 19-Mar-2023
    • (2023)A systematic literature review on Android-specific smellsJournal of Systems and Software10.1016/j.jss.2023.111677201:COnline publication date: 1-Jul-2023
    • (2023)Learning migration models for supporting incremental language migrations of software applicationsInformation and Software Technology10.1016/j.infsof.2022.107082153:COnline publication date: 1-Jan-2023
    • (2023)Understanding the quality and evolution of Android app build systemsJournal of Software: Evolution and Process10.1002/smr.2602Online publication date: 6-Aug-2023
    • (2022)LupaProceedings of the 19th International Conference on Mining Software Repositories10.1145/3524842.3528477(398-402)Online publication date: 23-May-2022
    • (2022)Mapping Modern JVM Language Code to Analysis-Friendly Graphs: A Study with KotlinInternational Journal of Software Engineering and Knowledge Engineering10.1142/S0218194022500735(1-22)Online publication date: 17-Dec-2022
    • Show More Cited By

    View Options

    Login options

    View options

    PDF

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader

    Figures

    Tables

    Media

    Share

    Share

    Share this Publication link

    Share on social media