SlideShare a Scribd company logo
Software MetricsEhsan hessamiIslamic Azad University OF Qazvin
What ?Software measurement is the mapping of symbols to objects
What ?Software measurement is the mapping of symbols to objectsWhy ?!!!!!!quantify some attribute of the objects
Criteria
CriteriaA metric must allow differententitiesto be distinguished.A metric must obey a representationcondition
Criteria…Each unit of the attribute must contribute an equivalent amount to the metricDifferent entities can have thesameattributevalue
Many timesthe attribute of interest is notdirectly measurable . An indirect measure involves ameasure and a predictionformula
Exampledensitymassvolume
Software Measurement Theory2 Kinds :numerical relation systemempirical relation system
The empirical relation systemtwo parts:A set of entities, EA set of relationships, R
The numerical relation systemtwo parts:A set of entities, NEXP : Integers , RealA set of relationships, PEXP : Less , Equal
MappingM, maps (E, R) to (N, P)related in the empirical systemrelated in the numberical system
MappingM, maps (E, R) to (N, P)related in the empirical systemrelated in the numberical systemEXP : x rel y if M(x) rel M(y)
EXP . Mappingmeasure, BIGX height=< Y height and X weight =< Y weight
MONOTONICITYIF increase the value of attribute , the object Will not Reverse.
MONOTONICITYIF increase the value of attribute , The object  will not Reverse. Exp : 2y = XMonotonicityX>0 And X<52y = 5x - xIncreaesX>=5 And X<10DecreaseNot Monotonicity
MEASUREMENT SCALESThere are five different scale types :nominalordinalintervalratioabsolute
NormalThis type basically assigns numbers or symbols without regard to any quantity
NormalThis type basically assigns numbers or symbols without regard to any quantityEXP:
Ordinalthere is an implied ordering of the entities by the numbers assigned to the entity
Ordinalthere is an implied ordering of the entities by the numbers assigned to the entityEXP: First  – SecondNot Equal1Second - third23
Intervalthe amount of the difference is constant
Intervalthe amount of the difference is constantEXP: converting from a Celsius to a FahrenheitFormule :  9.5 x +32
Ratiothe amount of the difference is constant and Well Zero
absoluteThe absolute is a counting scale measureEXP:
Product MetricsProduct metrics are metrics thatcan be calculated from the  document independent of how   it was produced . The most basic metric for size is thelinesof code metric .
McCABE’S CYCLOMATIC NUMBERintroduced in 1976 . Use the Gragh Theory : C  = E – N + 2C = Cyclomatic number .E = number of Edges .N = number of Eodes .
McCABE’S CYCLOMATIC NUMBEREXP : 51432E = 11 N = 8C = 11 – 8 + 2 C = 5
McCABE’S CYCLOMATIC NUMBERCalculating the cyclomatic number from control flow graphs is time-consuming . McCabe found a more directMethod of calculating his measure .
McCABE’S CYCLOMATIC NUMBERRestriction  : IN source Code : 1 decision   IF , For , While  Case or multiple Branch   1 less decision
McCABE’S CYCLOMATIC NUMBERRestriction … : Control flow graphs are required to have a distinct starting node and a distinct stoppingnodeFormula : C = D + 1D = Sum of Decisions
ExampleE = 2D = 1E = 2D = 1E = 3D = 2D  = 4 C = 5Complexity
Threshold ValueIf the Complexity is greater than 10, efforts should be made to reduce the value or to split the module
HALSTEAD’S SOFTWARE SCIENCEHe did his work in the late 1960s and 1970s.He empirically looked for measuresof intrinsic size
HALSTEAD’S SOFTWARE SCIENCEvariablesOperandsconstantscommasparenthesesOperatorarithmetic operatorsbrackets
Basic Measures—η1 and η2η = η1 + η2  η =total count of unique tokensCount of unique Operatorη1 =Count of unique Operands η2 =
Basic Measures—η1 and η2Exp :z = 0;While x> 0   z = z + y ;   x = x + 1;End –while ;Print(z) ;Operator = ; > + - Print () While-endwhileOperand z x y 0 1η1 =8 η2 = 5 η = 13
Length(N)N = N1 + N2  N =total count of tokensCount of OperatorN1 =Count of OperandsN2 =
LengthEXP : Operators=       3;        5While  1>        1+        1-        1Print   1()        1OperandsZ        4X        3Y        20        21        1z = 0;While x> 0   z = z + y ;   x = x + 1;End –while ;Print(z) ;N = N1 + N2 = 14+12 = 26
Estimate of the Length(est N)η1η2est N = η1*log    + η2*log22
Estimate of the Length(est N)η1η2est N = η1*log    + η2*log22Exp :η1=8  , η2=5est N = 8*3 +5*2.32 = 35.6
Volume ( V )Volume =  number of bits(η1+ η2)V = N * Log2
Volume ( V )Volume =  number of bits(η1+ η2)V = N * Log2Exp: N = 26 , η1=8  , η2=513V = 26 * Log   = 96.22
Potential Volume, V*Potential Volume =  Min number of bitsV* = (2 + η2*)log(2+ η2*)2η2* = The Minimal number of Operands
Other ParameterImplementation Level : L =  V* / V
Other ParameterImplementation Level : L =  V* / VEffort : E = V / L unit of Effors is emd
Other ParameterImplementation Level : L =  V* / VEffort : E = V / L unit of Effors is emdTime :T =  E / S18 emd / sec
HENRY–KAFURA INFORMATION FLOWmeasure the intermodule complexity of source code . HK = Weight *(out * in )iiiiIn = into the moduleiOut = out the module iWeight = weight the module i
HENRY–KAFURA INFORMATION FLOWExp  : Weight = 1 HK = 1110

More Related Content

PPTX
Unit i basic concepts of algorithms
PPTX
Design and Analysis of Algorithms
PPT
DESIGN AND ANALYSIS OF ALGORITHMS
PPT
Analysis Of Algorithms I
PPTX
1.4 Functions
PPTX
Csci101 lect01 first_program
PDF
Types of functions
Unit i basic concepts of algorithms
Design and Analysis of Algorithms
DESIGN AND ANALYSIS OF ALGORITHMS
Analysis Of Algorithms I
1.4 Functions
Csci101 lect01 first_program
Types of functions

What's hot (20)

DOCX
Types of functions, domain, range
PPT
Maps&hash tables
PDF
Data Structure: Algorithm and analysis
PPT
PDF
01 Analysis of Algorithms: Introduction
PPTX
Performance analysis(Time & Space Complexity)
PPTX
3.3 Logarithmic Functions
PPT
Fundamentals of the Analysis of Algorithm Efficiency
PDF
01. design & analysis of agorithm intro & complexity analysis
PPT
Divide and conquer
PPTX
Data Structures- Hashing
PPT
PPTX
Algorithm analysis and efficiency
PPTX
Algorithm Development
PPT
Cis435 week01
PDF
PPT
chapter 1
PDF
8th pre alg -l41
Types of functions, domain, range
Maps&hash tables
Data Structure: Algorithm and analysis
01 Analysis of Algorithms: Introduction
Performance analysis(Time & Space Complexity)
3.3 Logarithmic Functions
Fundamentals of the Analysis of Algorithm Efficiency
01. design & analysis of agorithm intro & complexity analysis
Divide and conquer
Data Structures- Hashing
Algorithm analysis and efficiency
Algorithm Development
Cis435 week01
chapter 1
8th pre alg -l41
Ad

Similar to Software Metrics (20)

PPTX
Unit3_Software-MDFJHGFUGJFSJDFMHGSAD,MFKJASDFH,ADSFGAKSIF,AWKJEHGF,Aetrics.pptx
PDF
Halstead's software science - ananalytical technique
PPTX
source code metrics and other maintenance tools and techniques
PPT
Software Engineering
PPT
5. HALSTEAD SOFTWARE SCIENCE.ppt software engineering
PPTX
Software Metrics (Testing)
PPTX
Software engineering module 4 notes for btech and mca
PPTX
Code metrics
PPTX
Code metrics
PDF
Complexity metrics and models
PDF
Complexity metrics and models
PDF
Software Metrics Course chapter 6 at Bahir Dar University
PDF
Software code metrics
PPTX
HALSTEAD COMPLEXITY-SOFTWARE METRICS AND ESTIMATION
PPT
Software metrics
PPTX
SE UNIT 5 part 2 (1).pptx
PPT
7-White Box Testing.ppt
PPTX
Software Metrics - Software Engineering
DOCX
Argument Papers (5-7 pages in length)1. Do schools perpe.docx
PDF
Survey paper
Unit3_Software-MDFJHGFUGJFSJDFMHGSAD,MFKJASDFH,ADSFGAKSIF,AWKJEHGF,Aetrics.pptx
Halstead's software science - ananalytical technique
source code metrics and other maintenance tools and techniques
Software Engineering
5. HALSTEAD SOFTWARE SCIENCE.ppt software engineering
Software Metrics (Testing)
Software engineering module 4 notes for btech and mca
Code metrics
Code metrics
Complexity metrics and models
Complexity metrics and models
Software Metrics Course chapter 6 at Bahir Dar University
Software code metrics
HALSTEAD COMPLEXITY-SOFTWARE METRICS AND ESTIMATION
Software metrics
SE UNIT 5 part 2 (1).pptx
7-White Box Testing.ppt
Software Metrics - Software Engineering
Argument Papers (5-7 pages in length)1. Do schools perpe.docx
Survey paper
Ad

Recently uploaded (20)

PDF
Electronic commerce courselecture one. Pdf
PDF
Encapsulation theory and applications.pdf
PPT
Teaching material agriculture food technology
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPTX
Spectroscopy.pptx food analysis technology
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
KodekX | Application Modernization Development
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Approach and Philosophy of On baking technology
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
DOCX
The AUB Centre for AI in Media Proposal.docx
Electronic commerce courselecture one. Pdf
Encapsulation theory and applications.pdf
Teaching material agriculture food technology
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Spectroscopy.pptx food analysis technology
Mobile App Security Testing_ A Comprehensive Guide.pdf
Network Security Unit 5.pdf for BCA BBA.
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
KodekX | Application Modernization Development
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Chapter 3 Spatial Domain Image Processing.pdf
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
The Rise and Fall of 3GPP – Time for a Sabbatical?
Approach and Philosophy of On baking technology
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Review of recent advances in non-invasive hemoglobin estimation
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
The AUB Centre for AI in Media Proposal.docx

Software Metrics