论文标题
我们需要改进的代码质量指标吗?
Do We Need Improved Code Quality Metrics?
论文作者
论文摘要
在过去的五十年中,软件开发社区一直在使用代码质量指标。尽管采用了广泛的采用,但代码质量指标仍引起了很多批评。在本文中,首先,我们通过调查软件开发人员来评估他们对当前实践和潜在差距的看法,并通过当前的指标来评估他们的意见。我们确定缺乏障碍,包括缺乏健全性,即指标准确捕获指标准确捕获概念的能力,缺乏评估软件体系结构质量的支持以及评估软件测试和基础架构的支持不足。在本文的第二部分中,我们专注于一个特定的代码质量指标-LCOM作为案例研究,以探索改善指标的机会。我们在定性和定量上评估现有的LCOM算法,以观察它们代表凝聚的概念。在这种追求中,我们首先创建了八种不同的案例,任何LCOM算法都必须涵盖并通过一组经验丰富的开发人员获得其凝聚力水平,并将其视为基础真理。我们表明,当前的LCOM算法的W.R.T.的作用很差。这些情况。为了弥合确定的差距,我们提出了一种新的方法来计算LCOM,并用地面真理评估新方法。我们还使用属于261个高质量Java存储库的9万多种类型的定量分析表明,目前的方法集对类凝聚力的非常不准确和误导性的图片。我们得出的结论是,当前使用的代码质量指标遭受各种缺陷,为研究界提供了足够的机会来解决差距。
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.