Do We Need Improved Code Quality Metrics?

12/22/2020
by   Tushar Sharma, et al.
0

The software development community has been using code quality metrics for the last five decades. Despite their wide adoption, code quality metrics have attracted a fair share of criticism. In this paper, first, we carry out a qualitative exploration by surveying software developers to gauge their opinions about current practices and potential gaps with the present set of metrics. We identify deficiencies including lack of soundness, i.e., the ability of a metric to capture a notion accurately as promised by the metric, lack of support for assessing software architecture quality, and insufficient support for assessing software testing and infrastructure. In the second part of the paper, we focus on one specific code quality metric-LCOM as a case study to explore opportunities towards improved metrics. We evaluate existing LCOM algorithms qualitatively and quantitatively to observe how closely they represent the concept of cohesion. In this pursuit, we first create eight diverse cases that any LCOM algorithm must cover and obtain their cohesion levels by a set of experienced developers and consider them as a ground truth. We show that the present set of LCOM algorithms do poorly w.r.t. these cases. To bridge the identified gap, we propose a new approach to compute LCOM and evaluate the new approach with the ground truth. We also show, using a quantitative analysis using more than 90 thousand types belonging to 261 high-quality Java repositories, the present set of methods paint a very inaccurate and misleading picture of class cohesion. We conclude that the current code quality metrics in use suffer from various deficiencies, presenting ample opportunities for the research community to address the gaps.

READ FULL TEXT

page 1

page 4

page 6

research
05/30/2019

A Study on Software Metrics and its Impact on Software Quality

Software metrics offer a quantitative basis for predicting the software ...
research
07/22/2023

A Quantitative Analysis of Open Source Software Code Quality: Insights from Metric Distributions

Code quality is a crucial construct in open-source software (OSS) with t...
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
10/23/2021

How Do I Refactor This? An Empirical Study on Refactoring Trends and Topics in Stack Overflow

An essential part of software maintenance and evolution, refactoring is ...
research
09/02/2021

APIzation: Generating Reusable APIs from StackOverflow Code Snippets

Developer forums like StackOverflow have become essential resources to m...
research
07/15/2021

One Thousand and One Stories: A Large-Scale Survey of Software Refactoring

Despite the availability of refactoring as a feature in popular IDEs, re...
research
07/30/2023

Measuring Software Testability via Automatically Generated Test Cases

Estimating software testability can crucially assist software managers t...

Please sign up or login with your details

Forgot password? Click here to reset