Proceedings of the Recent Advances in Artificial Intelligence for Sustainable Development (RAISD 2025)

Applicability of Lambda Expressions in Refactoring Near-Miss Micro-Clones in Java

Authors
Mehedi Hasan Shanto1, 2, *, Manishankar Mondal1, 2, Muhammad Asaduzzaman1, 2
1Computer Science and Engineering Discipline, Khulna University, Khulna, Bangladesh
2School of Computer Science, University of Windsor, Windsor, Canada
*Corresponding author. Email: shanto1832@cseku.ac.bd
Corresponding Author
Mehedi Hasan Shanto
Available Online 17 July 2025.
DOI
10.2991/978-94-6463-787-8_49How to use a DOI?
Keywords
Micro-clone; Refactoring; Lambda Expression; Java; Classification; Software Maintenance
Abstract

Duplicate code fragments, known as code clones, are a widespread phenomenon in software development, often causing difficulties in the maintenance and evolution of software systems. Micro-clones refer to short code fragments (i.e., less than five lines in length), which are particularly prevalent in the codebase. This study investigates the application of lambda expressions—a Java 8 functionality that enables the generation of concise and functional code segments, as a refactoring strategy for micro-clones. We focused and identified near-miss micro-clones of across five distinct subject systems using the NiCad clone detector. We have chosen 425 near-miss micro-clone pairs to ensure a 95% confidence level with a 5% confidence interval, based on the clone detector results for thorough investigation. Our findings indicate that 69.4% of these pairs can be refactored utilizing lambda refactoring technique. We also built a classifier using significant features based on Mann-Whitney-Wilcoxon U Test results from the micro-clones that achieved 78.91% accuracy. The effectiveness of lambda expressions in minimizing repetition, enhancing maintainability, and parameterizing the small changes in behavior among micro-clone fragments was verified by their feedback. We enhance the overall understanding of refactoring techniques and offer developers real insights to optimize their code bases.

Copyright
© 2025 The Author(s)
Open Access
Open Access This chapter is licensed under the terms of the Creative Commons Attribution-NonCommercial 4.0 International License (http://creativecommons.org/licenses/by-nc/4.0/), which permits any noncommercial use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license and indicate if changes were made.

Download article (PDF)

Volume Title
Proceedings of the Recent Advances in Artificial Intelligence for Sustainable Development (RAISD 2025)
Series
Advances in Intelligent Systems Research
Publication Date
17 July 2025
ISBN
978-94-6463-787-8
ISSN
1951-6851
DOI
10.2991/978-94-6463-787-8_49How to use a DOI?
Copyright
© 2025 The Author(s)
Open Access
Open Access This chapter is licensed under the terms of the Creative Commons Attribution-NonCommercial 4.0 International License (http://creativecommons.org/licenses/by-nc/4.0/), which permits any noncommercial use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license and indicate if changes were made.

Cite this article

TY  - CONF
AU  - Mehedi Hasan Shanto
AU  - Manishankar Mondal
AU  - Muhammad Asaduzzaman
PY  - 2025
DA  - 2025/07/17
TI  - Applicability of Lambda Expressions in Refactoring Near-Miss Micro-Clones in Java
BT  - Proceedings of the Recent Advances in Artificial Intelligence for Sustainable Development (RAISD 2025)
PB  - Atlantis Press
SP  - 634
EP  - 654
SN  - 1951-6851
UR  - https://doi.org/10.2991/978-94-6463-787-8_49
DO  - 10.2991/978-94-6463-787-8_49
ID  - Shanto2025
ER  -