arrow
返回

How and why we end up with complex methods: a multi-language study

delete2022-05-30
delete4
PRE
AI
M
Mateus Eustáquio Lopes
A
André Hora *
DOI:10.1007/s10664-022-10144-3delete
delete原文链接
delete原文求助
delete分享
delete收藏
摘要

摘要

En 中文
Over time, software systems tend to increase in complexity and become harder to maintain. While the drawbacks of code complexity are well-known, complex code is present in most real software projects. Here, an important question arises: why, with all the advice out there against it, do we continue to end up with complex methods? Unfortunately, code complexity is typically assessed for a single programming language (often Java), reducing the generality of findings. Thus, assessing how and why complex code evolves in multiple programming languages is fundamental to address this limitation. In this paper, we provide a multi-language empirical study to assess the evolution of complex methods and a survey to understand developers' perceptions. We analyze 1,000 complex methods (according to cyclomatic complexity) of 50 popular projects written in JavaScript, Python, Java, C++, and C# and we perform a survey with over 70 developers. We find that programming language plays an important role in the study of code complexity. For example, C++ and Python projects have more methods that increase complexity over time, whereas Java and C# present more efforts to reduce it. Moreover, the developers' perception of complexity is subjective and varies per programming language: many analyzed methods are not considered complex by developers, while others are considered well-written or harmless. Furthermore, developers may deliberately avoid refactoring complex code due to several reasons, including code stability and lack of refactoring priority. In some cases, developers are satisfied with complexity or even want to purposely expose it. Finally, based on our findings, we discuss insights for researchers and practitioners.
Keyword:
Code complexity
Code smells
Software maintenance
Software evolution
Empirical study

期刊

Empirical Software Engineering 封面图
Empirical Software Engineering
IF:
3.6
论文数:
2.0K
被引数:
5.3K

机构

U
Universidade Federal de Minas Gerais
学者数:
2.5W
论文数: 1.5W
被引数: 1.4W
引用论文

引用论文

err分享
err收藏
err分享
err收藏
err
IF0
err
err0
PREAI
err
err分享
err收藏
Recombination between an expressed immunoglobulin heavy-chain gene and a germline variable gene segment in a Ly 1+ B-cell lymphoma
err1986-08-01
err0
PREAI
errRobert Kleinfield; Richard R. Hardy; David Tarlinton; Jeffery Dangl; Leonard A. Herzenberg; Martin Weigert
err分享
err收藏
Performance Analysis of Variable Mode Adsorption Chiller at Different Recooling Water Temperatures
err2021-06-27
err0
errOAAI
errAhmad A. Alsarayreh; Ayman Al-Maaitah; Menwer Attarakih; Hans-Jörg Bart
err分享
err收藏
Design Considerations for Haptic and Auditory Map Interfaces
err2005-01-01
err0
PREAI
errMatt Rice; R. Daniel Jacobson; Reginald G. Golledge; David Jones
err分享
err收藏
学者 查看更多内容