首页> 外文会议>IEEE International Conference on Software Quality, Reliability and Security >Thresholds for Size and Complexity Metrics: A Case Study from the Perspective of Defect Density
【24h】

Thresholds for Size and Complexity Metrics: A Case Study from the Perspective of Defect Density

机译:大小和复杂性度量的阈值:缺陷密度视角下的案例研究

获取原文

摘要

Practical guidelines on what code has better quality are in great demand. For example, it is reasonable to expect the most complex code to be buggy. Structuring code into reasonably sized files and classes also appears to be prudent. Many attempts to determine (or declare) risk thresholds for various code metrics have been made. In this paper we want to examine the applicability of such thresholds. Hence, we replicate a recently published technique for calculating metric thresholds to determine high-risk files based on code size (LOC and number of methods), and complexity (cyclomatic complexity and module interface coupling) using a very large set of open and closed source projects written primarily in Java. We relate the threshold-derived risk to (a) the probability that a file would have a defect, and (b) the defect density of the files in the high-risk group. We find that the probability of a file having a defect is higher in the very high-risk group with a few exceptions. This is particularly pronounced when using size thresholds. Surprisingly, the defect density was uniformly lower in the very high-risk group of files. Our results suggest that, as expected, less code is associated with fewer defects. However, the same amount of code in large and complex files was associated with fewer defects than when located in smaller and less complex files. Hence we conclude that risk thresholds for size and complexity metrics have to be used with caution if at all. Our findings have immediate practical implications: the redistribution of Java code into smaller and less complex files may be counterproductive.
机译:关于什么代码具有更好质量的实用指南。例如,期望最复杂的代码是越野车是合理的。将代码构建到合理大小的文件和类也似乎是谨慎的。已经进行了许多确定(或声明)用于各种代码指标的风险阈值的尝试。在本文中,我们想检查这些阈值的适用性。因此,我们复制最近发布的技术,用于计算度量阈值,以基于代码大小(LOC和方法数)来确定高风险文件,以及使用非常大的开放和闭合源的复杂性(循环复杂性和模块接口耦合)主要在Java编写的项目。我们将阈值导出的风险与(a)相关的概率与(b)在高风险组中的文件中的缺陷密度。我们发现,具有少数例外的高风险组中具有缺陷的文件的概率更高。使用大小阈值时,这在特别明显。令人惊讶的是,在非常高风险的文件组中,缺陷密度均匀地较低。我们的结果表明,正如所预期的那样,较少的代码与更少的缺陷相关。但是,大型和复杂文件中的代码相同的代码与少于较少且更少于复杂的文件时的缺陷相关联。因此,我们得出结论,规模和复杂性度量的风险阈值必须小心使用如果大小。我们的调查结果具有即时实际影响:Java代码重新分配到更小,复杂的文件较小,可能是讨论的。

著录项

相似文献

  • 外文文献
  • 中文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号