An Empirical Study on Maintainable Method Size in Java

05/04/2022
by   Shaiful Alam Chowdhury, et al.
0

Code metrics have been widely used to estimate software maintenance effort. Metrics have generally been used to guide developer effort to reduce or avoid future maintenance burdens. Size is the simplest and most widely deployed metric. The size metric is pervasive because size correlates with many other common metrics (e.g., McCabe complexity, readability, etc.). Given the ease of computing a method's size, and the ubiquity of these metrics in industrial settings, it is surprising that no systematic study has been performed to provide developers with meaningful method size guidelines with respect to future maintenance effort. In this paper we examine the evolution of around 785K Java methods and show that developers should strive to keep their Java methods under 24 lines in length. Additionally, we show that decomposing larger methods to smaller methods also decreases overall maintenance efforts. Taken together, these findings provide empirical guidelines to help developers design their systems in a way that can reduce future maintenance.

READ FULL TEXT

page 9

page 10

research
08/15/2022

On the Adoption and Effects of Source Code Reuse on Defect Proneness and Maintenance Effort

Context. Software reusability mechanisms, like inheritance and delegatio...
research
12/01/2020

Design Level Metrics to Measure the Complexity Across Versions of AO Software

Software metric plays a vital role in quantitative assessment of any spe...
research
09/08/2021

On the differences between quality increasing and other changes in open source Java projects

Static software metrics, e.g., size, complexity and coupling are used in...
research
09/30/2022

Towards effective assessment of steady state performance in Java software: Are we there yet?

Microbenchmarking is a widely used form of performance testing in Java s...
research
07/09/2021

An Empirical Study of Data Constraint Implementations in Java

Software systems are designed according to guidelines and constraints de...
research
01/25/2019

Unveiling Exception Handling Guidelines Adopted by Java Developers

Despite being an old language feature, Java exception handling code is o...
research
04/04/2021

Assert Use and Defectiveness in Industrial Code

The use of asserts in code has received increasing attention in the soft...

Please sign up or login with your details

Forgot password? Click here to reset