Back to the 2026 paper

Module 3: Software Design & Metrics

20262m

Halstead's software science primarily uses counts of

(i) Modules and classes
(ii) Operators and operands
(iii) Test cases and defects
(iv) Inputs and outputs only

Worked SolutionAI Assisted

Solution

Correct Answer: (ii) Operators and operands

Explanation

Halstead's software science measures a program using counts of its operators and operands:

  • n1 = distinct operators, n2 = distinct operands
  • N1 = total operators, N2 = total operands

From these:

  • Vocabulary n = n1 + n2
  • Length N = N1 + N2
  • Volume V = N × log2(n)

Why other options are incorrect:

  • (i) Modules and classes - used in design metrics, not Halstead.
  • (iii) Test cases and defects - testing/quality metrics.
  • (iv) Inputs and outputs only - that is closer to Function Point Analysis.

Answer: (ii) Operators and operands

Similar questions

AI LearningWeb Platform

Coursify — Personal AI Course Generator

Struggling with a difficult subject or concept? Turn any engineering topic into a structured course with interactive lessons, quizzes, and research-backed explanations.