Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:

Лабораторная работа №1

.pdf
Скачиваний:
33
Добавлен:
01.05.2014
Размер:
131.24 Кб
Скачать

4

Протоколы

 

 

 

11

Dictionary

 

 

 

(

D)

:

47

Length

 

 

 

 

(

N)

:

417

Length estimation

 

( ^N)

:

214.081

Volume

 

 

 

 

(

V)

:

2316.26

Potential volume

 

 

( *V)

:

19.6515

Limit volume

 

 

(**V)

:

38.2071

Programming level

 

(

L)

:

0.00848413

Programming level estimation ( ^L)

:

0.0113422

Intellect

 

 

 

(

I)

:

26.2714

Time of programming

(

T)

:

15167.3

Time estimation

 

 

( ^T)

:

5824.55

Programming language level

(lambda) :

0.166726

Work on programming

(

E)

:

273011

Error

 

 

 

 

(

B)

:

1.40281

Error estimation

 

 

( ^B)

:

0.772088

Table:

 

 

 

 

 

 

 

 

====================================

 

 

Operators:

 

 

 

 

 

 

 

|

1

|

35

| ()

 

 

 

 

|

2

|

10

| +

 

 

 

 

|

3

|

9

|

-

 

 

 

 

|

4

|

1

|

/

 

 

 

 

|

5

|

59

|

;

 

 

 

 

|

6

|

9

|

<

 

 

 

 

|

7

|

27

|

=

 

 

 

 

|

8

|

6

|

>

 

 

 

 

|

9

|

2

|

>=

 

 

 

 

|

10

|

43

|

[]

 

 

 

 

|

11

|

5

|

and

 

 

 

 

|

12

|

1

|

eof

 

 

 

 

|

13

|

1

|

for

 

 

 

 

|

14

|

6

|

if

 

 

 

 

|

15

|

1

|

not

 

 

 

 

|

16

|

2

|

or

 

 

 

 

|

17

|

1

|

program

 

 

 

 

|

18

|

2

|

qsort

 

 

 

 

|

19

|

1

|

read

 

 

 

 

|

20

|

5

|

swap

 

 

 

 

|

21

|

1

|

type

 

 

 

 

|

22

|

5

|

while

 

 

 

 

|

23

|

1

| write

 

 

 

 

Operands:

 

 

 

 

 

 

 

|

1

|

1

|

0

 

 

 

 

|

2

|

23

|

1

 

 

 

 

|

3

|

1

|

10

 

 

 

 

|

4

|

1

|

2

 

 

 

 

|

5

|

1

|

20

 

 

 

 

|

6

|

1

|

5

 

 

 

 

|

7

|

3

|

F

 

 

 

 

|

8

|

1

|

TArray

 

 

 

 

|

9

|

3

|

a

 

 

 

 

|

10

|

3

|

hold

 

 

 

 

|

11

|

25

|

i

 

 

 

 

|

12

|

19

|

j

 

 

 

 

|

13

|

6

|

k

 

 

 

 

|

14

|

9

|

left

 

 

 

 

|

15

|

3

|

m

 

 

 

 

|

16

|

9

|

mid

 

 

 

 

|

17

|

2

|

n

 

 

 

 

|

18

|

3

|

p

 

 

 

 

|

19

|

9

|

pivot

 

 

 

 

|

20

|

1

|

prog_pas

 

 

 

 

|

21

|

3

|

q

 

 

 

 

|

22

|

10

|

right

 

 

 

 

|

23

|

22

|

sp

 

 

 

 

|

24

|

25

| x

 

 

 

 

Summary:

 

 

 

 

 

 

 

 

=====================================

 

 

The number of different operators

:

23

The number of different operands

 

:

24

 

 

 

 

 

 

 

 

 

 

4

Протоколы

 

 

12

The total number of operators

 

 

: 233

The total number of operands

 

 

: 184

Dictionary

 

 

 

(

D)

: 47

Length

 

 

 

 

(

N)

: 417

Length estimation

 

( ^N)

: 214.081

Volume

 

 

 

 

(

V)

: 2316.26

Potential volume

 

 

( *V)

: 19.6515

Limit volume

 

 

(**V)

: 38.2071

Programming level

 

(

L)

: 0.00848413

Programming level

estimation ( ^L)

: 0.0113422

Intellect

 

 

 

(

I)

: 26.2714

Time of programming

(

T)

: 15167.3

Time estimation

 

 

( ^T)

: 5824.55

Programming language level

(lambda)

: 0.166726

Work on programming

(

E)

: 273011

Error

 

 

 

 

(

B)

: 1.40281

Error estimation

 

 

( ^B)

: 0.772088

C

 

 

 

 

 

 

 

 

Statistics for module cpp.lxm

 

 

 

=====================================

 

The number of different operators

: 31

The number of different operands

 

: 26

The total number of operators

 

 

: 254

The total number of operands

 

 

: 191

Dictionary

 

 

 

(

D)

: 57

Length

 

 

 

 

(

N)

: 445

Length estimation

 

( ^N)

: 275.792

Volume

 

 

 

 

(

V)

: 2595.64

Potential volume

 

 

( *V)

: 19.6515

Limit volume

 

 

(**V)

: 38.2071

Programming level

 

(

L)

: 0.00757097

Programming level

estimation ( ^L)

: 0.0087823

Intellect

 

 

 

(

I)

: 22.7957

Time of programming

(

T)

: 19046.7

Time estimation

 

 

( ^T)

: 10176.2

Programming language level

(lambda)

: 0.148781

Work on programming

(

E)

: 342841

Error

 

 

 

 

(

B)

: 1.63283

Error estimation

 

 

( ^B)

: 0.865212

Table:

 

 

 

 

 

 

 

====================================

 

Operators:

 

 

 

 

 

 

|

1

|

1

|

!=

 

 

 

|

2

|

5

|

&&

 

 

 

|

3

|

35

|

()

 

 

 

|

4

|

9

|

+

 

 

 

|

5

|

4

|

++

 

 

 

|

6

|

15

|

,

 

 

 

|

7

|

6

|

-

 

 

 

|

8

|

3

|

--

 

 

 

|

9

|

1

|

/

 

 

 

|

10

|

52

|

;

 

 

 

|

11

|

9

|

<

 

 

 

|

12

|

1

|

<=

 

 

 

|

13

|

27

|

=

 

 

 

|

14

|

5

|

>

 

 

 

|

15

|

2

|

>=

 

 

 

|

16

|

43

|

[]

 

 

 

|

17

|

2

|

_&

 

 

 

|

18

|

3

|

_[]

 

 

 

|

19

|

3

|

__&

 

 

 

|

20

|

1

|

for

 

 

 

|

21

|

1

|

fprintf

 

 

 

|

22

|

1

|

fscanf

 

 

 

|

23

|

2

|

gets

 

 

 

|

24

|

6

|

if

 

 

 

|

25

|

1

|

main

 

 

 

|

26

|

2

|

qsort

 

 

 

 

 

 

 

 

 

 

 

 

5

Заключение

 

 

13

|

27

|

1

| return

 

 

 

|

28

|

5

| swap

 

 

 

|

29

|

1

| typedef

 

 

 

|

30

|

5

| while

 

 

 

|

31

|

2

| ||

 

 

 

Operands:

 

 

 

 

 

 

|

1

|

2

|

"%d"

 

 

 

|

2

|

7

|

0

 

 

 

|

3

|

15

|

1

 

 

 

|

4

|

1

|

2

 

 

 

|

5

|

1

|

20

 

 

 

|

6

|

2

|

21

 

 

 

|

7

|

1

|

5

 

 

 

|

8

|

1

|

EOF

 

 

 

|

9

|

4

|

a

 

 

 

|

10

|

4

|

ch

 

 

 

|

11

|

4

|

file

 

 

 

|

12

|

24

|

i

 

 

 

|

13

|

17

|

j

 

 

 

|

14

|

10

|

k

 

 

 

|

15

|

9

|

left

 

 

 

|

16

|

4

|

m

 

 

 

|

17

|

9

|

mid

 

 

 

|

18

|

2

|

n

 

 

 

|

19

|

3

|

p

 

 

 

|

20

|

9

|

pivot

 

 

 

|

21

|

3

|

q

 

 

 

|

22

|

10

|

right

 

 

 

|

23

|

19

|

sp

 

 

 

|

24

|

2

|

tmp

 

 

 

|

25

|

3

|

value

 

 

 

|

26

|

25

| x

 

 

 

Summary:

 

 

 

 

 

 

 

=====================================

 

The number of different operators

: 31

The number of different operands

 

: 26

The total number of operators

 

 

: 254

The total number of operands

 

 

: 191

Dictionary

 

 

 

(

D)

: 57

Length

 

 

 

 

(

N)

: 445

Length estimation

 

( ^N)

: 275.792

Volume

 

 

 

 

(

V)

: 2595.64

Potential volume

 

 

( *V)

: 19.6515

Limit volume

 

 

(**V)

: 38.2071

Programming level

 

(

L)

: 0.00757097

Programming level estimation ( ^L)

: 0.0087823

Intellect

 

 

 

(

I)

: 22.7957

Time of programming

(

T)

: 19046.7

Time estimation

 

 

( ^T)

: 10176.2

Programming language level

(lambda)

: 0.148781

Work on programming

(

E)

: 342841

Error

 

 

 

 

(

B)

: 1.63283

Error estimation

 

 

( ^B)

: 0.865212

5.Заключение

Врезультате выполнения работы был разработан вычислительный алгоритм и варианты программ его реализации на языках программирования C и Assembler. Для созданных программ были оценены метрические характеристики (измеримые и расчетные) по Холстеду. Для характеристик были также рассчитаны их оценки (где возможно).

Установлено, что при использовании языков программирования Pascal и С, различия в метрических характеристиках минимальны. Отсюда можно сделать вывод, что нет оснований утверждать о превосходстве одной из

5 Заключение

14

реализаций над другой на основании метрик Холстеда. С другой стороны, использование языка ассемблера может привести к значительному росту объема работы и числа ошибок.

Расчеты, проведенные вручную, большей частью согласуются с аналогичными, выполненными программным способом.