Understanding the impact of introducing Lambda expressions in Java Programs

Detalhes bibliográficos
Autor(a) principal: Lucas, Walter
Data de Publicação: 2020
Outros Autores: Fortes, José, Lopes, Francisco, Marcílio, Diego, Bonifácio, Rodrigo, Canedo, Edna, Lima, Fernanda, Saraiva, João
Tipo de documento: Artigo
Idioma: eng
Título da fonte: Repositório Científico de Acesso Aberto de Portugal (Repositórios Cientìficos)
Texto Completo: http://hdl.handle.net/1822/69124
Resumo: Background: The Java programming language version eight introduced several features that encourage the func­ tional style of programming, including the support for lambda expressions and the Stream API. Currently, there is a common wisdom that refactoring legacy code to introduce lambda expressions, besides other potential benefits, simplifies the code and improves program comprehension. Aims: The purpose of this work is to investigate this belief, conducting an in­depth study to evaluate the effect of introducing lambda expressions on program compre­hension. Method: We conducted this research using a mixed­method approach. For the quantitative method, we quantitatively analyzed 158 pairs of code snippets extracted directly either from GitHub or from recommendations from three tools (RJTL, NetBeans, and IntelliJ). We also surveyed practitioners to collect their perceptions about the benefits on program comprehension when introducing lambda expressions. We asked practitioners to evaluate and rate sets of pairs of code snippets. Results: We found contradictory results in our research. Based on the quantitative assessment, we could not find evidence that the introduction of lambda expressions improves software readability— one of the components of program comprehension. Our results suggest that the transformations recommended by the aforementioned tools decrease program comprehension when assessed by two state­of­the­art models to esti­mate readability. Differently, our findings of the qualitative assessment suggest that the introduction of lambda expression improves program comprehension in three scenarios when: we convert anonymous inner classes to a lambda expression, use structural loops with inner conditional to an anyMatch operator, and apply structural loops to filter operator combined with a collect method. Implications: We argue in this paper that one can improve program comprehension when he/she applies particular transformations to introduce lambda expressions (e.g., re­placing anonymous inner classes with lambda expressions). Also, the opinion of the participants highlights which kind of transformation for introducing lambda might be advantageous. This might support the implementation of effective tools for automatic program transformations.
id RCAP_be00bf0f1b63a0185e4a511b3269db48
oai_identifier_str oai:repositorium.sdum.uminho.pt:1822/69124
network_acronym_str RCAP
network_name_str Repositório Científico de Acesso Aberto de Portugal (Repositórios Cientìficos)
repository_id_str 7160
spelling Understanding the impact of introducing Lambda expressions in Java ProgramsProgram ComprehensionJava Lambda ExpressionsEmpirical StudiesEngenharia e Tecnologia::Engenharia Eletrotécnica, Eletrónica e InformáticaBackground: The Java programming language version eight introduced several features that encourage the func­ tional style of programming, including the support for lambda expressions and the Stream API. Currently, there is a common wisdom that refactoring legacy code to introduce lambda expressions, besides other potential benefits, simplifies the code and improves program comprehension. Aims: The purpose of this work is to investigate this belief, conducting an in­depth study to evaluate the effect of introducing lambda expressions on program compre­hension. Method: We conducted this research using a mixed­method approach. For the quantitative method, we quantitatively analyzed 158 pairs of code snippets extracted directly either from GitHub or from recommendations from three tools (RJTL, NetBeans, and IntelliJ). We also surveyed practitioners to collect their perceptions about the benefits on program comprehension when introducing lambda expressions. We asked practitioners to evaluate and rate sets of pairs of code snippets. Results: We found contradictory results in our research. Based on the quantitative assessment, we could not find evidence that the introduction of lambda expressions improves software readability— one of the components of program comprehension. Our results suggest that the transformations recommended by the aforementioned tools decrease program comprehension when assessed by two state­of­the­art models to esti­mate readability. Differently, our findings of the qualitative assessment suggest that the introduction of lambda expression improves program comprehension in three scenarios when: we convert anonymous inner classes to a lambda expression, use structural loops with inner conditional to an anyMatch operator, and apply structural loops to filter operator combined with a collect method. Implications: We argue in this paper that one can improve program comprehension when he/she applies particular transformations to introduce lambda expressions (e.g., re­placing anonymous inner classes with lambda expressions). Also, the opinion of the participants highlights which kind of transformation for introducing lambda might be advantageous. This might support the implementation of effective tools for automatic program transformations.Springer OpenUniversidade do MinhoLucas, WalterFortes, JoséLopes, FranciscoMarcílio, DiegoBonifácio, RodrigoCanedo, EdnaLima, FernandaSaraiva, João20202020-01-01T00:00:00Zinfo:eu-repo/semantics/publishedVersioninfo:eu-repo/semantics/articleapplication/pdfhttp://hdl.handle.net/1822/69124engMendonça, W. L. M., de Almeida, R. B., Fortes, J., Lopes, F. V., Marcílio, D., Canedo, E. D., ... & Saraiva, J. (2020). Understanding the Impact of Introducing Lambda Expressions in Java Programs. Journal of Software Engineering Research and Development, 8, 7-1https://doi.org/10.5753/jserd.2020.7442195-172110.5753/jserd.2020.744https://sol.sbc.org.br/journals/index.php/jserd/article/view/744info:eu-repo/semantics/openAccessreponame:Repositório Científico de Acesso Aberto de Portugal (Repositórios Cientìficos)instname:Agência para a Sociedade do Conhecimento (UMIC) - FCT - Sociedade da Informaçãoinstacron:RCAAP2023-07-21T12:18:10Zoai:repositorium.sdum.uminho.pt:1822/69124Portal AgregadorONGhttps://www.rcaap.pt/oai/openaireopendoar:71602024-03-19T19:10:55.179804Repositório Científico de Acesso Aberto de Portugal (Repositórios Cientìficos) - Agência para a Sociedade do Conhecimento (UMIC) - FCT - Sociedade da Informaçãofalse
dc.title.none.fl_str_mv Understanding the impact of introducing Lambda expressions in Java Programs
title Understanding the impact of introducing Lambda expressions in Java Programs
spellingShingle Understanding the impact of introducing Lambda expressions in Java Programs
Lucas, Walter
Program Comprehension
Java Lambda Expressions
Empirical Studies
Engenharia e Tecnologia::Engenharia Eletrotécnica, Eletrónica e Informática
title_short Understanding the impact of introducing Lambda expressions in Java Programs
title_full Understanding the impact of introducing Lambda expressions in Java Programs
title_fullStr Understanding the impact of introducing Lambda expressions in Java Programs
title_full_unstemmed Understanding the impact of introducing Lambda expressions in Java Programs
title_sort Understanding the impact of introducing Lambda expressions in Java Programs
author Lucas, Walter
author_facet Lucas, Walter
Fortes, José
Lopes, Francisco
Marcílio, Diego
Bonifácio, Rodrigo
Canedo, Edna
Lima, Fernanda
Saraiva, João
author_role author
author2 Fortes, José
Lopes, Francisco
Marcílio, Diego
Bonifácio, Rodrigo
Canedo, Edna
Lima, Fernanda
Saraiva, João
author2_role author
author
author
author
author
author
author
dc.contributor.none.fl_str_mv Universidade do Minho
dc.contributor.author.fl_str_mv Lucas, Walter
Fortes, José
Lopes, Francisco
Marcílio, Diego
Bonifácio, Rodrigo
Canedo, Edna
Lima, Fernanda
Saraiva, João
dc.subject.por.fl_str_mv Program Comprehension
Java Lambda Expressions
Empirical Studies
Engenharia e Tecnologia::Engenharia Eletrotécnica, Eletrónica e Informática
topic Program Comprehension
Java Lambda Expressions
Empirical Studies
Engenharia e Tecnologia::Engenharia Eletrotécnica, Eletrónica e Informática
description Background: The Java programming language version eight introduced several features that encourage the func­ tional style of programming, including the support for lambda expressions and the Stream API. Currently, there is a common wisdom that refactoring legacy code to introduce lambda expressions, besides other potential benefits, simplifies the code and improves program comprehension. Aims: The purpose of this work is to investigate this belief, conducting an in­depth study to evaluate the effect of introducing lambda expressions on program compre­hension. Method: We conducted this research using a mixed­method approach. For the quantitative method, we quantitatively analyzed 158 pairs of code snippets extracted directly either from GitHub or from recommendations from three tools (RJTL, NetBeans, and IntelliJ). We also surveyed practitioners to collect their perceptions about the benefits on program comprehension when introducing lambda expressions. We asked practitioners to evaluate and rate sets of pairs of code snippets. Results: We found contradictory results in our research. Based on the quantitative assessment, we could not find evidence that the introduction of lambda expressions improves software readability— one of the components of program comprehension. Our results suggest that the transformations recommended by the aforementioned tools decrease program comprehension when assessed by two state­of­the­art models to esti­mate readability. Differently, our findings of the qualitative assessment suggest that the introduction of lambda expression improves program comprehension in three scenarios when: we convert anonymous inner classes to a lambda expression, use structural loops with inner conditional to an anyMatch operator, and apply structural loops to filter operator combined with a collect method. Implications: We argue in this paper that one can improve program comprehension when he/she applies particular transformations to introduce lambda expressions (e.g., re­placing anonymous inner classes with lambda expressions). Also, the opinion of the participants highlights which kind of transformation for introducing lambda might be advantageous. This might support the implementation of effective tools for automatic program transformations.
publishDate 2020
dc.date.none.fl_str_mv 2020
2020-01-01T00:00:00Z
dc.type.status.fl_str_mv info:eu-repo/semantics/publishedVersion
dc.type.driver.fl_str_mv info:eu-repo/semantics/article
format article
status_str publishedVersion
dc.identifier.uri.fl_str_mv http://hdl.handle.net/1822/69124
url http://hdl.handle.net/1822/69124
dc.language.iso.fl_str_mv eng
language eng
dc.relation.none.fl_str_mv Mendonça, W. L. M., de Almeida, R. B., Fortes, J., Lopes, F. V., Marcílio, D., Canedo, E. D., ... & Saraiva, J. (2020). Understanding the Impact of Introducing Lambda Expressions in Java Programs. Journal of Software Engineering Research and Development, 8, 7-1
https://doi.org/10.5753/jserd.2020.744
2195-1721
10.5753/jserd.2020.744
https://sol.sbc.org.br/journals/index.php/jserd/article/view/744
dc.rights.driver.fl_str_mv info:eu-repo/semantics/openAccess
eu_rights_str_mv openAccess
dc.format.none.fl_str_mv application/pdf
dc.publisher.none.fl_str_mv Springer Open
publisher.none.fl_str_mv Springer Open
dc.source.none.fl_str_mv reponame:Repositório Científico de Acesso Aberto de Portugal (Repositórios Cientìficos)
instname:Agência para a Sociedade do Conhecimento (UMIC) - FCT - Sociedade da Informação
instacron:RCAAP
instname_str Agência para a Sociedade do Conhecimento (UMIC) - FCT - Sociedade da Informação
instacron_str RCAAP
institution RCAAP
reponame_str Repositório Científico de Acesso Aberto de Portugal (Repositórios Cientìficos)
collection Repositório Científico de Acesso Aberto de Portugal (Repositórios Cientìficos)
repository.name.fl_str_mv Repositório Científico de Acesso Aberto de Portugal (Repositórios Cientìficos) - Agência para a Sociedade do Conhecimento (UMIC) - FCT - Sociedade da Informação
repository.mail.fl_str_mv
_version_ 1799132540399779840