Halstead theory - Total number of distinct operator & operand occurrences measures

Q.  The total number of distinct operator and operand occurrences measures are used in ______ .
- Published on 19 Oct 15

a. Lawrence theory
b. Halstead's theory
c. Kyburg, H. E.
d. Jech, T.

ANSWER: Halstead's theory
 

    Discussion

  • Nirja Shah   -Posted on 23 Oct 15
    - Researchers generally agree that simple size measures like lines of code (LOC) are not adequate for determining software complexity and development effort.

    - They are of the view that, for this purpose, a programming process model is needed.

    - This model is based upon manageable number of factors, that affect the complexity and quality of the software systems.

    - A number of researchers including Halstead, McCabe have attempted to define such programming models.

    - Halstead’s model also known as theory of software science is based on the hypothesis that program construction involves a process of mental manipulation of the unique operators (n1) and unique operands (n2).

    - It means that a program of N1 operators and N2 operands is constructed by selecting among n1 unique operators and n2 unique operands.

    - By using this model, Halstead derived a number of equations related to programming such as program level, the implementation effort, language level and so on.

    - Also, it is one of the most widely studied theories and has been supported by a number of empirical studies.

    - An important and interesting characteristic of this model is that a program can be analyzed for various features like size, effort etc. by simply counting its basic parameters n1, n2, N1 and N2.

    - Program vocabulary is defined as

    N = n1 + n2

    - And program actual length as

    N = N1 + N2

    - One of the hypotheses of this theory is that the length of a well - structured program is a function of n1 and n2 only. This relationship is known as length prediction equation and is defined as

    Nh= n1log2n1 + n2log2n2

    - This length equation estimates the size of the program from the counts of unique operators (n1) and unique operands (n2).

    - If the actual length (N) agrees well with the estimated value (Nh), then the program is considered as well structured.

Post your comment / Share knowledge


Enter the code shown above:
 
(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)