- It is introduced by M.H.Halsted in 1977.
- Halsted science is an estimation technique to find out the size, time, and effort of a software.
- Halstead complexity is based upon counts of operators and operands. The operators are:- if, ( , ) , { , } , = , + , - , * , ; , etc. And, the operands are x , k , 3 , 2 ,4 , or we can say that the value we take in the program.
- The number of unique operators and operands( η1 and η2 ) as well as the total number of operators and operator ( N1 and N2 ).
- η1 is the number of distinct operators.
- η1 is the number of distinct operands.
- N1 total occurrences of operators.
- N2 total occurrences of operands.
From this number, the following measures can be calculated:-
1. Program length (N)
Program length (N) = N1 + N2
2. Vocabulary size (η)
Vocabulary size (η) = η1 + η2
3. Program volume (V)
Program volume(V) = N * log2 η
4. Difficulty level (D)
Difficulty level (D) = η1 /2 * N2 / η2
Difficulty level (D) = η1 * N2 / η2 * N1
5. Program level (L)
Program level (L) = 1/D
6. Effort to implement (E)
Effort to implementation (E) = V * D
7. Estimated program length
Estimated program length = η1 log2 η1 + η2 log2 η1
8. Potential volume ( V )
Potential volume ( V ) = (2 + η2* )log ( 2 + η2* )
9. Estimated program level/difficulty ( L )
Estimated program level/difficulty ( V ) = 2 η2 / η1N2
10. Effort ( E )
Effort ( E ) = V / L = V * D
11. Time to implement ( T )
Time to implement ( T ) = E / β
ADVANTAGE
- It is simple to calculate.
- It is useful in scheduling projects.
- It measures the overall quality of programs.
- It can be used for any programming language.
- It predicts ( see ) effort and time.
- UT predicts ( see ) the rate of error.
DISADVANTAGE
- It depends on the usage of operators and operands in the completed code.
Post a Comment
Post a Comment