2023年6月28日发(作者:)
龙源期刊网
浅谈程序复杂度计算方法
作者:赵志斌 李兵川
来源:《科教导刊》2013年第24期
摘 要 随着计算机应用的普及和社会对软件产品的更高要求,软件产品的研发也越来越复杂。程序复杂度已经成为评估软件质量的一个重要指标之一。程序复杂度的度量可以估算程序中的错误,也可以科学计算程序员的编程工作量。正确地降低程序复杂度可以降低研发成本,提高研发效率。
关键词 计算机应用 软件质量 程序复杂度
中图分类号:TP311.11 文献标识码:A
Study on Calculation Method of Program Complexity
ZHAO Zhibin, LI Bingchuan
(Chongqing Creation Vocational College, Chongqing 412160)
Abstract With the popularity of computer application and the higher requirement of society for
the software products, software products research and development is becoming more and more
complex. The complexity of program has become one of the important indicators to evaluate software
quality, which can estimate errors in the program and also can scientifically calculate the amount of
programming for programmers. Correctly reduction of program complexity can decrease the cost of
research and development and improve the efficiency.
Key words computer application; software quality; program complexity
程序复杂度的度量是指一种代码复杂度的衡量标准。它关系到开发经费、开发周期和软件内部bug的多少。正确降低软件复杂度可以提高对软件的理解和软件的可维护性。
那么程序的复杂度怎么计算?下面我们探讨常见的两种复杂度度量方法:
1 统计程序的源代码行数来估量程序的复杂度
该方法的基本思想是统计程序中代码有效行数,以统计的源代码行数做为程序复杂度的度量估计值。值得注意的是在统计程序代码行数时该统计的行数不应该包括空白、注释、括号以及成员、类型和命名空间的声明等。假设程序的出错概率为每100行源程序代码中可能有的bug数,我们可以设程序中每100行源代码中出现一个错误,则该程序的出错概率被估算为百分之一,记为1%。经验告诉我们,程序出错概率的估算范围大约是在百分之零点零四至百分
发布者:admin,转转请注明出处:http://www.yc00.com/xiaochengxu/1687894753a54682.html
评论列表(0条)