网站首页  英汉词典

请输入您要查询的英文单词:

 

单词 Cyclomatic complexity
释义

Cyclomatic complexity

中文百科

循环复杂度

简单程序的控制流图。此程序由红色的节点开始运行,然后进入循环(红色节点下由三个节点组成),离开循环后有条件分支,最后运行蓝色节点后结束,此控制流图中,E = 9, N = 8, P = 1,因此其循环复杂度为 9 - 8 + (2*1) = 3
对应同一个程序的控制流图,但多加一个从结束点到启始点的边,因此为强连通的控制流图,若利用此图计算循环复杂度,其公式为M=E-N+P,而E = 10、N = 8、P = 1,因此循环复杂度为3

循环复杂度Cyclomatic complexity)也称为条件复杂度圈复杂度,是一种软件度量,是由老托马斯·J·麦凯布在1976年提出,用来表示程序的复杂度,其符号为VG或是M。循环复杂度由程序的源代码中量测线性独立路径的个数。此概念有些类似的量测文本复杂度的Flesch-Kincaid可读性测试 ,不过方法不完全相同。


循环复杂度是由程序的控制流图来计算:有向图的节点对应程序中个别的代码,而若一个程序运行后会立刻运行另一代码,会有边链接二代码对应的节点。圈复杂度可应用在程序的子进程、模块、方法或类别。

英语百科

Cyclomatic complexity 循环复杂度

A control flow graph of a simple program. The program begins executing at the red node, then enters a loop (group of three nodes immediately below the red node). On exiting the loop, there is a conditional statement (group below the loop), and finally the program exits at the blue node. This graph has 9 edges, 8 nodes, and 1 connected component, so the cyclomatic complexity of the program is 9 - 8 + 2*1 = 3.
The same function as above, represented using the alternative formulation, where each exit point is connected back to the entry point. This graph has 10 edges, 8 nodes, and 1 connected component, which also results in a cyclomatic complexity of 3 using the alternative formulation (10 - 8 + 1 = 3).
The control flow graph of the source code above; the red circle is the entry point of the function, and the blue circle is the exit point. The exit has been connected to the entry to make the graph strongly connected.

Cyclomatic complexity is a software metric (measurement), used to indicate the complexity of a program. It is a quantitative measure of the number of linearly independent paths through a program's source code. It was developed by Thomas J. McCabe, Sr. in 1976.

随便看

 

英汉网英语在线翻译词典收录了3779314条英语词汇在线翻译词条,基本涵盖了全部常用英语词汇的中英文双语翻译及用法,是英语学习的有利工具。

 

Copyright © 2004-2024 encnc.com All Rights Reserved
更新时间:2025/6/18 12:42:06