3. Расчет метрических характеристик
Расчет метрических характеристик по Холстеду для программы написанной на языке программирования C, производились с помощью программParser_C.exeиMetrics.exe. Ниже приведены результаты роботы программы:
Statistics for module output.lxm
=====================================
The number of different operators : 21
The number of different operands : 25
The total number of operators : 114
The total number of operands : 141
Dictionary ( D) : 46
Length ( N) : 255
Length estimation ( ^N) : 208.335
Volume ( V) : 1408.5083
Potential volume ( *V) : 11.6
Limit volume (**V) : 23.2
Programming level ( L) : 0.0082
Programming level estimation ( ^L) : 0.0169
Intellect ( I) : 23.7843
Time of programming ( T) : 17102.48
Time estimation ( ^T) : 14341.18
Programming language level (lambda) : 0.0955
Work on programming ( E) : 171025.485
Error ( B) : 0.469515
Error estimation ( ^B) : 0.406327
Table:
====================================
Operators:
| 1 | 7 | ()
| 2 | 11 | *
| 3 | 5 | +
| 4 | 4 | ++
| 5 | 5 | +=
| 6 | 4 | {}
| 7 | 5 | -
| 8 | 6 | /
| 9 | 4 | <
| 10 | 19 | =
| 11 | 9 | []
| 12 | 3 | _&
| 13 | 5 | _*
| 14 | 5 | _[]
| 15 | 3 | __*
| 16 | 4 | for
| 17 | 2 | linfit1
| 18 | 1 | main
| 19 | 4 | printf
| 20 | 1 | random
| 21 | 1 | randomize
Operands:
| 1 | 1 | "Input Data: \n"
| 2 | 1 | "a: %3.1f, b: %3.1f\n"
| 3 | 1 | "x[%d] = %3.1f y[%d] = %3.1f\n"
| 4 | 1 | "y_calc = %3.1f\n"
| 5 | 10 | 0
| 6 | 5 | 10
| 7 | 1 | 20
| 8 | 6 | a
| 9 | 6 | b
| 10 | 27 | i
| 11 | 7 | n
| 12 | 8 | size
| 13 | 7 | sum_x
| 14 | 5 | sum_x2
| 15 | 5 | sum_xy
| 16 | 7 | sum_y
| 17 | 4 | sum_y2
| 18 | 4 | sxx
| 19 | 3 | sxy
| 20 | 2 | syy
| 21 | 7 | x
| 22 | 6 | xi
| 23 | 6 | y
| 24 | 5 | y_calc
| 25 | 6 | yi
Summary:
=====================================
The number of different operators : 21
The number of different operands : 25
The total number of operators : 114
The total number of operands : 141
Dictionary ( D) : 46
Length ( N) : 255
Length estimation ( ^N) : 208.335
Volume ( V) : 1408.5083
Potential volume ( *V) : 11.6
Limit volume (**V) : 23.2
Programming level ( L) : 0.0082
Programming level estimation ( ^L) : 0.0169
Intellect ( I) : 23.7843
Time of programming ( T) : 17102.48
Time estimation ( ^T) : 14341.18
Programming language level (lambda) : 0.0955
Work on programming ( E) : 171025.485
Error ( B) : 0.469515
Error estimation ( ^B) : 0.406327
Расчет метрических характеристик по Холстеду для программы написанной на языке программирования Pascal, производились с помощью программParser_Pas.exeиMetrics.exe. Ниже приведены результаты роботы программы:
Statistics for module output.lxm
=====================================
The number of different operators : 15
The number of different operands : 34
The total number of operators : 82
The total number of operands : 148
Dictionary ( D) : 49
Length ( N) : 230
Length estimation ( ^N) : 231.577
Volume ( V) : 1291.38
Potential volume ( *V) : 11.6
Limit volume (**V) : 23.2
Programming level ( L) : 0.00902
Programming level estimation ( ^L) : 0.0306306
Intellect ( I) : 39.5559
Time of programming ( T) : 143764.7185
Time estimation ( ^T) : 12216.28
Programming language level (lambda) : 0.1042
Work on programming ( E) : 14376.47185
Error ( B) : 0.643708
Error estimation ( ^B) : 0.430461
Table:
====================================
Operators:
| 1 | 7 | ()
| 2 | 11 | *
| 3 | 7 | +
| 4 | 5 | -
| 5 | 6 | /
| 6 | 22 | :=
| 7 | 9 | []
| 8 | 1 | const
| 9 | 4 | for
| 10 | 2 | linfit1
| 11 | 1 | program
| 12 | 1 | random
| 13 | 1 | randomize
| 14 | 1 | type
| 15 | 4 | writeln
Operands:
| 1 | 1 | ' b: '
| 2 | 1 | ' y['
| 3 | 1 | 'Input Data: '
| 4 | 2 | '] = '
| 5 | 1 | 'a: '
| 6 | 1 | 'x['
| 7 | 1 | 'y_calc: '
| 8 | 2 | 0
| 9 | 5 | 0.0
| 10 | 8 | 1
| 11 | 3 | 10
| 12 | 2 | 2
| 13 | 2 | 20
| 14 | 5 | 3
| 15 | 1 | LineFit
| 16 | 6 | a
| 17 | 1 | ary
| 18 | 6 | b
| 19 | 15 | i
| 20 | 5 | max
| 21 | 7 | n
| 22 | 8 | sum_x
| 23 | 6 | sum_x2
| 24 | 6 | sum_xy
| 25 | 8 | sum_y
| 26 | 5 | sum_y2
| 27 | 4 | sxx
| 28 | 3 | sxy
| 29 | 2 | syy
| 30 | 7 | x
| 31 | 6 | xi
| 32 | 6 | y
| 33 | 5 | y_calc
| 34 | 6 | yi
Summary:
=====================================
The number of different operators : 15
The number of different operands : 34
The total number of operators : 82
The total number of operands : 148
Dictionary ( D) : 49
Length ( N) : 230
Length estimation ( ^N) : 231.577
Volume ( V) : 1291.38
Potential volume ( *V) : 11.6
Limit volume (**V) : 23.2
Programming level ( L) : 0.00902
Programming level estimation ( ^L) : 0.0306306
Intellect ( I) : 39.5559
Time of programming ( T) : 143764.7185
Time estimation ( ^T) : 12216.28
Programming language level (lambda) : 0.1042
Work on programming ( E) : 14376.47185
Error ( B) : 0.643708
Error estimation ( ^B) : 0.430461
Расчет метрических характеристик для программы на языке программирования Assemblerпроводился вручную.
Операторы |
Количество |
|
Операнды |
Количество |
assume |
2 |
|
bp+10 |
1 |
push |
26 |
|
bp+14 |
1 |
mov |
47 |
|
bp-8 |
14 |
sub |
7 |
|
bp-16 |
9 |
fldz |
5 |
|
bp-24 |
5 |
fstp |
25 |
|
bp-32 |
5 |
xor |
7 |
|
bp-40 |
4 |
fwait |
14 |
|
bp+4 |
2 |
shl |
9 |
|
pb-48 |
5 |
add |
15 |
|
bp-56 |
5 |
fld |
19 |
|
bp+6 |
1 |
fadd |
6 |
|
bp-64 |
2 |
fmul |
9 |
|
bp-72 |
3 |
inc |
4 |
|
bp+12 |
2 |
cmp |
4 |
|
bp+8 |
1 |
fild |
6 |
|
bp-18 |
4 |
fdivr |
4 |
|
bp-178 |
3 |
fsubr |
3 |
|
bp-338 |
3 |
fdiv |
2 |
|
bp-518 |
1 |
fsub |
1 |
|
bp-498 |
2 |
pop |
11 |
|
bp-508 |
3 |
ret |
2 |
|
bp-516 |
1 |
call |
10 |
|
bp |
8 |
imul |
2 |
|
sp |
15 |
lea |
10 |
|
si |
28 |
swd |
1 |
|
di |
7 |
jge |
1 |
|
bx |
27 |
jmp short @2@226 |
1 |
|
ax |
59 |
jmp short @1@114 |
1 |
|
dx |
24 |
jmp short @1@226 |
1 |
|
cl |
18 |
jmp @2@114 |
1 |
|
cs |
2 |
jmp @2@5 |
1 |
|
cx |
4 |
call near ptr _time |
1 |
|
82 |
1 |
call near ptr _rand |
1 |
|
3 |
17 |
call near ptr N_LXMUL@ |
1 |
|
498 |
1 |
call near ptr N_LDIV@ |
1 |
|
12 |
1 |
call near ptr _printf |
4 |
|
10 |
8 |
call near ptr _linfit1 |
1 |
|
20 |
4 |
call near ptr _srand
|
1 |
|
-2768 |
1 |
jl short @2@170 |
1 |
|
8 |
10 |
jl short @1@58 |
1 |
|
0 |
11 |
jl short @1@170 |
1 |
|
'Input Data: ' |
1 |
Итого |
270 |
|
'x[%d] = %.1f y[%d] = %.1f' |
1 |
|
|
|
'a: %.1f, b: %.1f' |
1 |
|
|
|
'y_calc = %.1f' |
1 |
|
|
|
Итого |
327 |
Метрики Холстеда | |
Число уникальных операторов (n1): |
42 |
Число уникальных операндов (n2): |
46 |
Общее число операторов (N1): |
270 |
Общее число операндов (N2): |
327 |
Алфавит (n): |
88,0000 |
Экспериментальна длина программы (Nэ): |
597,0000 |
Теоретическая длина программы (Nт): |
480,5612 |
Объём программы (V): |
3856,2807 |
Потенциальный объём (V*): |
11,6000 |
Уровень программы (L): |
0,0030 |
Сложность программы (S): |
332,4380 |
Ожидание уровня программы (L^): |
0,0067 |
Интеллект программы (I): |
25,8321 |
Работа по программированию (Е): |
1281974,1944 |
Время кодирования (T): |
128197,4194 |
Ожидаемое время кодирования (T^): |
97567,5639 |
Уровень языка программирования (Lam): |
0,0349 |
Уровень ошибок (В): |
1,2854 |