SlideShare a Scribd company logo
3
Most read
14
Most read
17
Most read
HALSTEAD’S SOFTWARE SCIENCE
- AN ANALYTICAL TECHNIQUE
PROJECT ESTIMATION TECHNIQUES
● Empirical Estimation Techniques
● Heuristic Techniques
● Analytical Estimation Techniques
○ HALSTEAD’S SOFTWARE SCIENCE
INTRODUCTION
Halstead’s Technique measure
● Size
● Development effort
● Development cost of s/w products
INTRO (cont’d)
Halstead used few primitive program parameters to develop expressions for:
● Overall program length
● Potential minimum volume and Program level
● Actual volume
● Effort
● Development time
INTRO (cont’d)
For any giving programs lets define the following parameters:
● η1
be the number of unique operators used in the program
● η2
be the number of unique operands used in the program
● N1
be the number of the total operators used in the program
● N2
be the number of the total operands used in the program
INTRO (cont’d)
Operator in general: a symbol or function representing a mathematical
operation.
● assignments arithmetic and logical operators
● Parentheses pair, block begin/end pair
● If…then… else… endif
● Do…. While
● Statement terminator “;”
● Bitwise operator
● Pointers operator
INTRO (cont’d)
Operands in general: A quantity to which an operator is applied
● Subroutine declarations
● Variable declarations
● Variables and constants used with operators in an expression
Operators and Operands for the ANSI C Language
● List of operators
( [ . , -> * + - ~ ! ++ -- * / % + - << >> < > <= >= != == & ^ | && ||
= *= /= %= += -= <<= >>= &= ^= |= : ? { ; CASE DEFAULT IF ELSE SWITCH
WHILE DO FOR GOTO CONTINUE BREAK RETURN and a function name in
function call
● Operands are those variables and constants which are used with
operators in expressions
Eg : a=&b;
a,b are operands and = & are operators
Length and Vocabulary
● Length : total usage of all operators and operands ie., total number of
tokens used in the program
Program Length (N)= N1
+ N2
● Vocabulary : is the number unique operands and operators used in the
program
Program Vocabulary (η)= η1
+ η2
Program Volume
● Program vocabulary and length depends on the programming style
● Different lengths of programs, corresponding to the same problem when
different languages are used
● We need to express the program length by taking the programming
language into consideration
Program volume (V) is the minimum number of bits needed to encode the
program
Program Volume (cont’d)
Program volume V = N log2
(η)
● To represent η different tokens we need log2
(η) bits
○ Example: to represent 8 operands we need 3 bits
● For a program of N length, we need N log2
(η) bits
Program volume represents the size of the program by approximately
compensating the effect of the programming language used
Potential Minimum Volume (V*)
● V* is the volume of the most concise program in which the problem can
be coded
● A program require at least 2 operators (η1
=2) and the required number of
operands is η2
=n
V* = (2+η2
) log2
(2+η2
)
Potential Minimum Volume (V*) (cont’d)
Program Level (L) = V*/V
● Program level measures the level of abstraction provided by
programming language
● Higher L, less effort it takes to develop a program using that language
○ Example: Assembly vs. C#
Effort and Time
● To obtain the needed effort , we divide the program volume (size) on the
program level (complexity)
Effort (E) = V / L
= V2
/ V* (as L = V*/V)
● The programmer’s time needed to finish the program
T = E / S
where S is the speed of mental discriminations, recommended value of S
is 18
Length Estimation
● Although the program length can be estimated easily using the previous
discussed equation N = N1
+N2
, this can be done before starting the
programming activities.
● Instead, we can calculate the length depending on the unique numbers of
operands and operators
Length Estimation (cont’d)
Halstead assumptions are based on:
● Program are unlikely to have several identical parts that are greater than
(η)
● Identical parts are usually made into procedures and functions
N = η1
log2
(η1
) + η2
log2
(η2
)
● Experimental evidence showed that the actual and the computed values
are very close
● Results may be inaccurate when dealing with small programs or
subsystems individually
Recap
● Unique operators : η1
● Unique Operands : η2
● Total Operators : N1
● Total Operands : N2
● Program Vocabulary: η=η1
+η2
● Program Length : N=N1
+N2
● Program Volume : Nlog2
η
● Effort : E=V/L
● Time : T=E/S
● Estimated Length : N=η1
log2
η1
+η2
log2
η2
Example
Main()
{
int a, b, c, avg;
scanf(“%d %d %d”, &a, &b, &c);
avg = (a +b +c )/3;
printf(“avg = %d”, avg);
}
Example (cont’d)
● The unique operators are: main, (), {}, int, scanf, &, “, “, “ ; ”, =, +, /, printf
● The unique operands are : a, b, c, &a, &b, &c, a +b +c, avg, 3, “%d %d %d”,
“avg = %d”
therefore η1 = 12, η2 = 11
N = 12 log2(12)+ 11log2(11) = 81
V = Nlog2(η) = 81log2(23) = 366
THANKYOU

More Related Content

PPTX
Software requirements specification
PPT
Software design
PPTX
Metrics for project size estimation
PPTX
Lect4 software economics
PPT
insertion sort.ppt
PPTX
Software Engineering Layered Technology Software Process Framework
PPTX
Defining the Problem - Goals and requirements
PPTX
Functional and non functional
Software requirements specification
Software design
Metrics for project size estimation
Lect4 software economics
insertion sort.ppt
Software Engineering Layered Technology Software Process Framework
Defining the Problem - Goals and requirements
Functional and non functional

What's hot (20)

PPTX
Testing strategies part -1
PDF
SOFTWARE PROJECT PLANNING on Software Engineering
PDF
Software Engineering : Requirement Analysis & Specification
PDF
Time and Space Complexity
PDF
Deadlock Avoidance - OS
PPTX
Software architecture
PPTX
Threads .ppt
PPT
UML Diagrams
PPTX
Semaphore
PPTX
Advanced Structural Modeling
PPT
Deadlock detection and recovery by saad symbian
PPT
Transaction slide
PDF
Serializability
PPT
The Software Development Process
PDF
Requirement Engineering
PDF
ccs356-software-engineering-notes.pdf
PDF
Black Box Testing
PDF
Measures of query cost
PPTX
serializability in dbms
Testing strategies part -1
SOFTWARE PROJECT PLANNING on Software Engineering
Software Engineering : Requirement Analysis & Specification
Time and Space Complexity
Deadlock Avoidance - OS
Software architecture
Threads .ppt
UML Diagrams
Semaphore
Advanced Structural Modeling
Deadlock detection and recovery by saad symbian
Transaction slide
Serializability
The Software Development Process
Requirement Engineering
ccs356-software-engineering-notes.pdf
Black Box Testing
Measures of query cost
serializability in dbms
Ad

Viewers also liked (20)

PPTX
A comparative review of various approaches for feature extraction in Face rec...
PPTX
Micro Programmed Control Unit
DOCX
PDF
Cpm systems-pvt-ltd
PDF
Swpanica Exim; India II Proma Doors II OB Modular Kitchen II Omeya Bath Set I...
DOCX
Ejercicio de revision 1
PPTX
Industrialism
PPTX
DOCX
Proceso desarrollo humano slideshare
PPTX
21st century skills k to 12
DOCX
Report about AB Bank
PDF
Chapter 6 software metrics
PPTX
Participatory Educational Planning
PPTX
New business plan( Green Coconut- Sipco)
PPTX
Ekonomiks 10 - Kalakalang Panlabas ng Pilipinas
PPT
Microprogram Control
PPS
Control statements
PPTX
PPTX
PPTX
Mnatenimieto de tablet version 3
A comparative review of various approaches for feature extraction in Face rec...
Micro Programmed Control Unit
Cpm systems-pvt-ltd
Swpanica Exim; India II Proma Doors II OB Modular Kitchen II Omeya Bath Set I...
Ejercicio de revision 1
Industrialism
Proceso desarrollo humano slideshare
21st century skills k to 12
Report about AB Bank
Chapter 6 software metrics
Participatory Educational Planning
New business plan( Green Coconut- Sipco)
Ekonomiks 10 - Kalakalang Panlabas ng Pilipinas
Microprogram Control
Control statements
Mnatenimieto de tablet version 3
Ad

Similar to Halstead's software science - ananalytical technique (20)

PPT
5. HALSTEAD SOFTWARE SCIENCE.ppt software engineering
PPTX
Halsted’s Software Science-An analytical technique
PPTX
HALSTEAD COMPLEXITY-SOFTWARE METRICS AND ESTIMATION
PPSX
Software Metrics
PDF
Software Metrics Course chapter 5 at Bahir Dar University
PPTX
Unit3_Software-MDFJHGFUGJFSJDFMHGSAD,MFKJASDFH,ADSFGAKSIF,AWKJEHGF,Aetrics.pptx
PPTX
source code metrics and other maintenance tools and techniques
PDF
Data Structures Notes
DOC
Implementation of halstead
PPTX
DA lecture 3.pptx
PPTX
Data Structures and Agorithm: DS 22 Analysis of Algorithm.pptx
PPT
Design and Analysis of Algorithm Fundamental
PPT
codingtechniques1.ppt
PPT
Lecture 1 and 2 of Data Structures & Algorithms
PPTX
Fundamentals of Programming in Visual basic
DOCX
Unit 2 Modeling of Programs A function maps inputs to out.docx
PDF
Software code metrics
PPT
Algorithm And analysis Lecture 03& 04-time complexity.
PPT
How to calculate complexity in Data Structure
PPTX
Performance analysis and randamized agoritham
5. HALSTEAD SOFTWARE SCIENCE.ppt software engineering
Halsted’s Software Science-An analytical technique
HALSTEAD COMPLEXITY-SOFTWARE METRICS AND ESTIMATION
Software Metrics
Software Metrics Course chapter 5 at Bahir Dar University
Unit3_Software-MDFJHGFUGJFSJDFMHGSAD,MFKJASDFH,ADSFGAKSIF,AWKJEHGF,Aetrics.pptx
source code metrics and other maintenance tools and techniques
Data Structures Notes
Implementation of halstead
DA lecture 3.pptx
Data Structures and Agorithm: DS 22 Analysis of Algorithm.pptx
Design and Analysis of Algorithm Fundamental
codingtechniques1.ppt
Lecture 1 and 2 of Data Structures & Algorithms
Fundamentals of Programming in Visual basic
Unit 2 Modeling of Programs A function maps inputs to out.docx
Software code metrics
Algorithm And analysis Lecture 03& 04-time complexity.
How to calculate complexity in Data Structure
Performance analysis and randamized agoritham

More from Vishnupriya T H (6)

PDF
Computer graphics - colour crt and flat-panel displays
PDF
Security challenges in IoT
PDF
Apache HBase
PPTX
Security auditing architecture
PPTX
Sampling design, sampling errors, sample size determination
PPTX
Introduction to Triz (TIPS)
Computer graphics - colour crt and flat-panel displays
Security challenges in IoT
Apache HBase
Security auditing architecture
Sampling design, sampling errors, sample size determination
Introduction to Triz (TIPS)

Recently uploaded (20)

PPTX
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
PPTX
additive manufacturing of ss316l using mig welding
PPTX
OOP with Java - Java Introduction (Basics)
PPTX
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
PPTX
web development for engineering and engineering
PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
PDF
Operating System & Kernel Study Guide-1 - converted.pdf
PDF
PPT on Performance Review to get promotions
PDF
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
PPTX
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PPTX
Foundation to blockchain - A guide to Blockchain Tech
PPTX
UNIT 4 Total Quality Management .pptx
PDF
Digital Logic Computer Design lecture notes
DOCX
573137875-Attendance-Management-System-original
PPT
Project quality management in manufacturing
PPTX
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
PDF
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
PDF
Well-logging-methods_new................
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
additive manufacturing of ss316l using mig welding
OOP with Java - Java Introduction (Basics)
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
web development for engineering and engineering
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
Operating System & Kernel Study Guide-1 - converted.pdf
PPT on Performance Review to get promotions
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
Foundation to blockchain - A guide to Blockchain Tech
UNIT 4 Total Quality Management .pptx
Digital Logic Computer Design lecture notes
573137875-Attendance-Management-System-original
Project quality management in manufacturing
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
Well-logging-methods_new................

Halstead's software science - ananalytical technique

  • 1. HALSTEAD’S SOFTWARE SCIENCE - AN ANALYTICAL TECHNIQUE
  • 2. PROJECT ESTIMATION TECHNIQUES ● Empirical Estimation Techniques ● Heuristic Techniques ● Analytical Estimation Techniques ○ HALSTEAD’S SOFTWARE SCIENCE
  • 3. INTRODUCTION Halstead’s Technique measure ● Size ● Development effort ● Development cost of s/w products
  • 4. INTRO (cont’d) Halstead used few primitive program parameters to develop expressions for: ● Overall program length ● Potential minimum volume and Program level ● Actual volume ● Effort ● Development time
  • 5. INTRO (cont’d) For any giving programs lets define the following parameters: ● η1 be the number of unique operators used in the program ● η2 be the number of unique operands used in the program ● N1 be the number of the total operators used in the program ● N2 be the number of the total operands used in the program
  • 6. INTRO (cont’d) Operator in general: a symbol or function representing a mathematical operation. ● assignments arithmetic and logical operators ● Parentheses pair, block begin/end pair ● If…then… else… endif ● Do…. While ● Statement terminator “;” ● Bitwise operator ● Pointers operator
  • 7. INTRO (cont’d) Operands in general: A quantity to which an operator is applied ● Subroutine declarations ● Variable declarations ● Variables and constants used with operators in an expression
  • 8. Operators and Operands for the ANSI C Language ● List of operators ( [ . , -> * + - ~ ! ++ -- * / % + - << >> < > <= >= != == & ^ | && || = *= /= %= += -= <<= >>= &= ^= |= : ? { ; CASE DEFAULT IF ELSE SWITCH WHILE DO FOR GOTO CONTINUE BREAK RETURN and a function name in function call ● Operands are those variables and constants which are used with operators in expressions Eg : a=&b; a,b are operands and = & are operators
  • 9. Length and Vocabulary ● Length : total usage of all operators and operands ie., total number of tokens used in the program Program Length (N)= N1 + N2 ● Vocabulary : is the number unique operands and operators used in the program Program Vocabulary (η)= η1 + η2
  • 10. Program Volume ● Program vocabulary and length depends on the programming style ● Different lengths of programs, corresponding to the same problem when different languages are used ● We need to express the program length by taking the programming language into consideration Program volume (V) is the minimum number of bits needed to encode the program
  • 11. Program Volume (cont’d) Program volume V = N log2 (η) ● To represent η different tokens we need log2 (η) bits ○ Example: to represent 8 operands we need 3 bits ● For a program of N length, we need N log2 (η) bits Program volume represents the size of the program by approximately compensating the effect of the programming language used
  • 12. Potential Minimum Volume (V*) ● V* is the volume of the most concise program in which the problem can be coded ● A program require at least 2 operators (η1 =2) and the required number of operands is η2 =n V* = (2+η2 ) log2 (2+η2 )
  • 13. Potential Minimum Volume (V*) (cont’d) Program Level (L) = V*/V ● Program level measures the level of abstraction provided by programming language ● Higher L, less effort it takes to develop a program using that language ○ Example: Assembly vs. C#
  • 14. Effort and Time ● To obtain the needed effort , we divide the program volume (size) on the program level (complexity) Effort (E) = V / L = V2 / V* (as L = V*/V) ● The programmer’s time needed to finish the program T = E / S where S is the speed of mental discriminations, recommended value of S is 18
  • 15. Length Estimation ● Although the program length can be estimated easily using the previous discussed equation N = N1 +N2 , this can be done before starting the programming activities. ● Instead, we can calculate the length depending on the unique numbers of operands and operators
  • 16. Length Estimation (cont’d) Halstead assumptions are based on: ● Program are unlikely to have several identical parts that are greater than (η) ● Identical parts are usually made into procedures and functions N = η1 log2 (η1 ) + η2 log2 (η2 ) ● Experimental evidence showed that the actual and the computed values are very close ● Results may be inaccurate when dealing with small programs or subsystems individually
  • 17. Recap ● Unique operators : η1 ● Unique Operands : η2 ● Total Operators : N1 ● Total Operands : N2 ● Program Vocabulary: η=η1 +η2 ● Program Length : N=N1 +N2 ● Program Volume : Nlog2 η ● Effort : E=V/L ● Time : T=E/S ● Estimated Length : N=η1 log2 η1 +η2 log2 η2
  • 18. Example Main() { int a, b, c, avg; scanf(“%d %d %d”, &a, &b, &c); avg = (a +b +c )/3; printf(“avg = %d”, avg); }
  • 19. Example (cont’d) ● The unique operators are: main, (), {}, int, scanf, &, “, “, “ ; ”, =, +, /, printf ● The unique operands are : a, b, c, &a, &b, &c, a +b +c, avg, 3, “%d %d %d”, “avg = %d” therefore η1 = 12, η2 = 11 N = 12 log2(12)+ 11log2(11) = 81 V = Nlog2(η) = 81log2(23) = 366