控制流图圈复杂度确定
V(G) =流图中区域个数 (由结点和边围起来的区域—图中外部区域也是一个区域)
V(G) = 边的个数- 结点个数 + 2
V(G) =流图中(简单)判定结点个数+ 1
圈复杂度(Cyclomatic complexity)(环形复杂性):
是一种为程序逻辑复杂性提供定定量测度的软件度量。
当该度量用于基本路径测试方法,计算所得的值给出了程序基本集的独立路径数量,这是为确保所有语句至少执行一次而必须进行测试数量的上界。
可用以下3种方法之一来计算复杂性:
2. Determine the cyclomatic complexity of the resultant flow graph
Note: can be determined without developing a flow graph
count all conditional statements in a component
compound conditions count as 2
(number of Boolean operators + 2)
8点基2时间抽取FFT算法流图
X1[0]
X1[1]
X1[2]
X1[3]
X2[0]
X2[1]
X2[2]
X2[3]
X [0]
X [1]
X [2]
X [3]
X [4]
X [5]
X [6]
X [7]
-1
-1
-1
-1
4点DFT
4点DFT
x[0]
x[2]
x[4]
x[6]
x[1]
x[3]
x[5]
x[7]