我们需要改进代码质量吗?
Do We Need Improved Code Quality Metrics?
摘要:
在过去的五十年里,软件开发社区一直在使用代码质量度量。尽管它们被广泛采用,但代码质量度量还是招致了相当多的批评。在本文中,首先,我们进行了一个定性的探索,调查软件开发人员,以衡量他们的意见,目前的做法和潜在的差距,目前的一套指标。我们发现了不足之处,包括缺乏健全性,即,度量准确捕获度量所承诺的概念的能力,缺乏对评估软件体系结构质量的支持,以及对评估软件测试和基础设施的支持不足。在本文的第二部分,我们专注于一个特定的代码质量指标LCOM作为一个案例研究,探索改进指标的机会。我们评估现有的LCOM算法定性和定量地观察他们如何密切代表的概念的凝聚力。在这种追求中,我们首先创建了八个不同的情况下,任何LCOM算法都必须覆盖,并通过一组经验丰富的开发人员获得其内聚水平,并将其视为基础事实。我们表明,目前的一套LCOM算法做差w.r.t.这些案件。为了弥合所确定的差距,我们提出了一种新的方法来计算LCOM和评估新的方法与地面真相。我们还表明,使用定量分析,使用超过9万种类型属于261个高质量的Java存储库,目前的一套方法描绘了一个非常不准确和误导性的图片类的凝聚力。我们的结论是,目前使用的代码质量指标存在各种缺陷,为研究界提供了充分的机会来解决这些差距。
英文摘要:
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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。