CS FundamentalsHardGATE CS · product-company placement

A module has 10 distinct operators, 16 distinct operands, 60 operator occurrences and 48 operand occurrences. Using Halstead's metrics, D = (n1/2) x (N2/n2) and E = D x V with V = N log2 n, what are the difficulty and effort?

  1. A. D = 18.75, E ≈ 9,518
  2. B. D = 15, E ≈ 7,615
  3. C. D = 15, E ≈ 508
  4. D. D = 3, E ≈ 1,523

Correct answer: B. D = 15, E ≈ 7,615

D = (10/2) x (48/16) = 15; N = 108, n = 26, V = 108 x log2 26 ≈ 507.6, so E ≈ 15 x 507.6 ≈ 7,615. Using N1 instead of N2 gives 18.75; 508 is the volume, not the effort.

More Software Engineering, Git and Cloud Basics questions

Exams that ask this topic