跳转到内容

软体缺陷指标

维基百科,自由的百科全书

软体缺陷指标(Software Defect Indicator)是源代码中会出现的一些模式,和程序错误有强烈的相关性,程序错误是指程式码中有错误或是遗漏程式,会因此造成程式的动作异常。在检视计算机程序时,不一定每次都可以直接识别到程式的错误,但因为软体缺陷指标有固定的型式(有时也称为反面模式代码异味),表示程式有可能有问题。

以下是一些软体缺陷指标的例子:

  • 无效不会执行的程式:已撰写好的程式码,而程式设计者刻意关闭程式不执行,也没有相关注解说明此程式为何要关闭,或是这程式何时会恢复执行的资讯。
  • 函式太过复杂:程式(方法、模组、副程式、函式、子函式、程序,或是任何有名称的一块程式码)中包括了十个条件叙述中的逻辑判断式[1]
  • 没用到的变数:没有参考到的变数意味著可能有其他的错误[2]
  • 软体提交者的数量:是指专案提交(commit)历史上有贡献开发者的个数。这是流程指标,对于指出软体缺陷很有帮助 [3]

相关条目[编辑]

参考资料[编辑]

  1. ^ William T. Ward: "Software Defect Prevention Using McCabe's Complexity Metric", Hewlett-Packard Journal, April 1989, pp 64-69: Control-flow complexity has been correlated with low reliability and frequent errors.
  2. ^ David N. Card, Victor E. Church, and William W. Agresti: "An Empirical Study of Software Design Practices", IEEE Transactions on Software Engineering, SE-12, no. 2, February 1986, pp 264-71: 46 percent of routines with no unused variables had no errors compared to only 17 to 29 percent for those with one or more unreferenced variables.
  3. ^ Madeyski, Lech, and Marian Jureczko. “Which Process Metrics Can Significantly Improve Defect Prediction Models? An Empirical Study.” Software Quality Journal 23.3 (2015): 393–422. Web.

外部链接[编辑]