软件测试 | assignment4

Operator Number of Occurrences
if 1
< 1
+= 1
1
int 1
+ 6
* 2
/ 4
% 1
dayray 1
return 1
n1 = 11 N1 = 20
Operand Number of Occurrences
month 3
3 1
12 1
year 5
day 1
1 1
26 1
10 1
4 1
6 1
100 1
400 1
7 1
n2 = 13 N2 = 19

Halstead Metrics

  • n1=11,n2=13,N1=20,N2=19n_1 = 11 , n_2= 13, N_1 = 20, N_2 = 19
  • 程序词汇表长度 Program vocabulary: n=n1+n2=24n = n_1 + n_2 = 24
  • 程序长度或简单长度 Program length: N=N1+N2=39N = N_1 + N_2 = 39
  • 程序的预测长度 Calculated program length:N^ =n1log2n1+n2log2n2=86.15946n_1 log_2n_1+n_2log_2n_2= 86.15946
  • 程序体积或容量 Program volume: V=Nlog2(n)=178.81V = Nlog_2(n) = 178.81
  • 程序级别Program level: L^ =(2/n1)(n2/N2)=2/1113/19=0.124= (2/n_1) * (n_2/N_2) = 2/11 * 13/19 = 0.124
  • 程序难度Program difficulty: D=1/D = 1/L^ =8.03846= 8.03846
  • 编程工作量 Effort: E=VD=V/E = V * D = V/L^ = 1437.3571437.357
  • 语言级别: Lʹ = L^ * L^ * V = 2.749382562.74938256
  • 编程时间 (hours): T^ = E/(Sf)=E/(606018)=0.02218E/(S * f) = E/(60*60*18) = 0.02218
  • 平均语句大小: N/=39/4=9.75N/语句数 = 39/4 = 9.75
  • 程序中的错误数预测值: B=V/3000=Nlog2(n)/3000=0.0596B = V/3000 = Nlog_2(n)/3000 = 0.0596

相关文章:

  • 2021-02-11
  • 2021-11-04
  • 2021-10-15
  • 2021-12-31
  • 2021-12-17
  • 2022-12-23
  • 2021-11-27
  • 2021-12-15
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-05-20
  • 2021-10-05
  • 2021-10-25
  • 2021-04-12
  • 2021-08-20
相关资源
相似解决方案