返回
How and why we end up with complex methods: a multi-language study
DOI:10.1007/s10664-022-10144-3.png)
摘要
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
期刊
IF:
3.6
论文数:
2.0K
被引数:
5.3K
机构
引用论文
Recombination between an expressed immunoglobulin heavy-chain gene and a germline variable gene segment in a Ly 1+ B-cell lymphoma
Nature
IF0
Performance Analysis of Variable Mode Adsorption Chiller at Different Recooling Water Temperatures
Energies
IF0

