SlideShare une entreprise Scribd logo
1  sur  16
Télécharger pour lire hors ligne
Software Engineering (KCS-601)
Unit-3 (Second Part): Software Metrics
Dr. Radhey Shyam
Professor
Department of Computer Science and Engineering
SRMCEM Lucknow
(Affiliated to Dr. A.P.J. Abdul Kalam Technical University, Lucknow)
Unit-3 (Second part) have been compiled/prepared by Dr. Radhey Shyam, with grateful acknowledgment
who made their course contents freely available or (Contributed directly or indirectly). Feel free to use this
study material for your own academic purposes. For any query, the communication can be made through
this mail shyam0058@gmail.com.
April 18, 2022
Soktwahe Moi
LAtuanr Meic o a
e L
ChaadTe ietis wi a guaru
Cautalle
Cturan
m
u u a d i i b l e
tale Mtsics ane wpetat o n a n
acens nelmdin
Penomanee, lamm n w lomo M
pmdutliwit, a mam tha uCea,
Meacun n
7Maio ahe an imotant Coen
ualt acsuramu Manasemot debus
iming e ano
mami
a valnalle tr bth devlAare a
denel mot am lendars,
e n a dieren setw MaT
O RLad sAtwane MDit eyelmdlic
Cala funlow Poinh and LoC
matrics, Cnebv
FP and Loc bas
elatinel
LOT a g.nelia of Colo
Course Name: M. Tech Halto AAsae sei C
A
aetaralt rdiclod wa
t o u n
Semester: 2nd Logk N, t N
Paper Name: Object Oriented Software Engineering (MTCS-203B) 7
Topic: Halstead's Software Science. ocahulay7,f n
wlam N
Halstead's SoftwareScience
Halstead's Software Science
Halstead's complexity measurement was developed to measure a program module's complexiny
directly from source code, with emphasis on
computational complexity.
The Halstead's measures are based on four scalar number derived directly from a program s
source code:
n 1S number of distinct operators.
n2 is number of distinct operands.
eurYante v
Ni is total number of/distinct operators.
N is total number ofdistinct operands
From these numbers, five measures are derived:
Measure Symbol Formula
Program length N N=NI +Na
Programvocabulary N n=nitn2
Volume V=N* (log2 n)
Difficulty D D (n1/2)*(N2/2)
Effort E E=D*V
iaistead's uses certain measures such as program length, program vocabulary, v
difficulty, and effort for the given algorithm. By this Halstead's is trying to show that une
program length can be caleulated, volume of algorithm can be estimated. The above given table
shows how actually these measure can be obtained.
The Halstead's measures are applicable to operational system and to development eforts once
the code has been written. Thus using Halstead's measurement experimental verification can be
performed in software science.
Program length:
The length of a program is total usage of operators and operands in the program.
Length (N) =Ni+N2
Program vocabulary:
The Program vocabulary is the number of unique operators and operands used in the program.
Vocabulary (n) = ni t n2
Program Volume:
The Program Volume can be defined as minimum number of bits needed to encode the program.
Volume (V) = N loga n
Length estimation:
N=ni log2 ni t n2 log2 n2
Guideline for caleulating operands and operators:
1. All the variables and constants are considered as operands.
2. Local variables with same name, if occurring in different functions are counted as unique
operand.
3. Function calls are considered as operators.
4 The looping statements, do... while, while, for, are operators. The statements i, i
else, are operators. The switch . . .
case statements are considered as operators.
5. The reserve worlds, returns, default, continue, break, sizeof are all operators.
6. The brackets, commas, semicolons, are operators.
7. The unary and binary operators are considered as operators. The & is considered
as
operator.
8. In arrays, array name and index are considered as operands and [ ] is considered
as
operator.
9. All hash directives can be ignored.
10. Comments are not considered.
11. In Goto statement, goto is considered as operatorand label as operand.
Example: Obtain Halstead's length and volume measure for following C function.
)
(CtinatashengtE
Void swap (int a[ ], int i)
uelwme N n
int temp;
Fr Comptalia H a l s a r e l ' s
m e
bistineF eporators ) {Fi
ne efperards; K 2 3
= -N=)
Temp ali
ail ali+1];:
afi+1]=temp; legti N) =
N,tNa=lct
17
pLabulayln)= n,#n2 = 8t4=12
N=10
We first find out the operands and operators from above function along with their occurrences.
Operands Occurrences Operators Occurrences
swap
5
void
temp
int 3
4
3
2
N-21
Na
Caledali HaltEmdnpluma lo
w
# GCD lopuldio
n geel (,1)
n2=9
N 16
n=5
N=Ni+N:
=
16+21 =37
rtile(= t)
N=37
n =nitn2
=
5 +9 =
14
d
-T-
n= 14
Estimated length =
n1 log ni + n2 log n2
=
5 iog 5 +9 log 93 . 1 1
= 5*2.32 +9*2.19 =31.37
GrpeTands eumemeas oralnd |aelunen
Estimated length =
31.37
whde
VolumeN * log n
Y
M
37 *
log (14) d de
381
elu
37*2.63=97.64
3
Volume (V) =
97.64
3
33
13 2
n
n,+) 3t13 - I6 2
NI =
14.Na 20
Estima longt =
, t73
N=
N+ N,= l4+20 = 3
Rume z
34x 6)
34x 136
3 3+ 13up13
3(1.58S)+ 13(3-))
=S2
t le uaattalne
Opelemalt lopleyi
MeaswR t t mumos "k uneavy imdelouda
Pacte e Cole. 'maidy u t e y a l u a t e
Compay oa p
ase ase mt ho Coployy
Cn be lomleitad tngly f+low
V(G)=e -n+2f He 'oth m
t mo. des, and p
T R
na,
6 Cewwnaitd Comaemanb.
4) Hene
Po e mo. TdCa
o d e ,
(11 v(4)= No. agions
&. Copul yelemue Cerkae us floin
CL=
e -
nt2
= 8
1 0
CoReee e
VG)=lo - 8+2
umda
2+2
4
e l c e
(vC) 7.
1 V(G Monr aA
me lemfpla
(
E a - l P
i0
wtlCicn-1)d
i+1:
wil(i4 n) do
Ai) 4A(1)
Surp (ACi) AU
i+1
e d.
Compute eyelsnaiu abeue lnsrapy
CLat v¢) o abe 9s.
U N C T I O N POINT
ystv la. mlboms, ap2,
wobuts
olusaluen
m a m u m m
ond
m u n m u n ,
MLbucs a ptouclsup
khimolio
u a n s l i t
Th peg.2el. soblesn and
d l e r e l a f l A h b r B c l u c l
MloLLLALL
o u t a n d p o p u l e r 4
l u e r i m l l y
b l u n g u L L d
pund
)Euncluafa peuul
lo2einaleBge
otes_LoC)
Ladis
a v a i l a k L _
t e L l h m a L L
Thu
m i l u c
L a & L L k e R
The
TLpuettc_by
c e u M l u s
A
M M A N A =
SeLLAcLImLLlucluennlUn Ahe
a l l
/ m e l u c i s
d u a l o k n c d h e a s u a n
W h u l l C
c o i n L u s n g
hl Ma
imsluuciera, luaps_nedat_communluny
th
cOd AMd
hindur/_lnsaKLA9mg/u
Aoc hastkellewas)sherlcennin8
OC
Loc
a l u m l e u c a l
ualue (e
oc
Jeblom
e h a t saM May
wrdily
May wdaly
dlfaluesmt
ithindudkcal
codin STyle.0
dfaUnen
preisammusay wiÍAeAcOtelI.n
dhfewnl wayllsFA Lg Om seavW
paLeawm
Reutal Bowmce mklnuub
MnRAwhuak amathpp
Lng M3uln
a-
LAMg{
acluos8
oC Aunlal kles
aclun mLas _ol h codn
900d alsnl Om Th/ Dthn honmd,
O 900d bupblum
BheullK
e
DAUL COMMaleu Akplal llplmincdhd
LA MUal L
LLL9M CAde lhtll,Elc_am
LoC hewluue ocuL
Lh
LAdng0clwly alrn
CAAmLpAulus
MUoky
hs
imalpiugMa_n
ce lais_haoly lh
Ahe aualils_amd liotmcys//EhL
MIsauily( wnply kati auabtu
highi ndy
u lamalunes
kurel Aannjual
hughi
L E N L L y _
heha th_doc coundwll
Thsuweudd AhuA8a
L m a l l p r R a M M A
asglo2us8AuL_hr doCceu as
measulee
h lal pul un
dllueml/deselghalus,_thy weula.
a
C o d e l u s e b l d u r l e
b dis Vceunagm
Page2-
wUuy dllucull nal o p
Alumali Jod/U Che
accutal p.
Che buob lemn
A0Ccoul ca
specAlca)
OMA
Cempuld 0nly
bcemJullyfdevn Le
mama9.eLS
dusun hsotr.cl la
amy hvelol, 4
e l CUMU-be/øm
aclurty
h a l s L l a s i l j d
6199.c8L
th ZoC 0nelile
h o t l c o r
em he
M A m a e b e n s p i C l u V
peml melbuic
Mluc
houlceminIS
umcEM.
Funche boiint
maMy
m.gliuc LSuncids
late 1970 'S uNcZien
nta Aehulalpiy
ueposkd_by ALbuchM
h
isnportamt aduamlojA3 Lt
mcluen peun AMTLUc/ Au
lhalt CaM
LLnatl hiiac walp
LeducZ
LLclLcalue
diuctly am he Vpuebi
ncpiuo Lcaobihna
ABCLCiy
Page3 6
A
dapundemt
Lu JumcluoLS gt
h
Asetwant oduct Supporlin
lanfe
.
aluslksLwolLd
S Lhama bsoclucl
Lialuste
ia ads some
lasle
Cdaumly
tvnlh Qess no
whna
Lach
dala amd Uan
Siommsd LO he coHespondm? _eutpul
mclon
dala
PumdernemtMetuc
parammmlesus
No f
Ne
uspil/s
Na Na
nalliius ales
No:1-
ntnlaces
FP
UFP * TCF
Umoduslaol
EumclueM
Pomls
Lechancal
Compleaiy
Facle
TCF 0 65 0:01 X DL
degLe
imlluhace
Dbndent M14paranmelsuswtuch
A8gmid walue
Lathocie )No S49milnul
Imodlnla
Moduroti
OL N psLl No nm
5LStMgInlluim
4 Na Abuls
ach data lum mpul by
2 No lpu
Lach_Ldala lem
eilput by hs p
SNo LAAQLLIHILL
No lduimcd intiuaclue quLrLLs hch
caM
4No
A Lhal (l Aapluus a ueup AoLucally
uldltid
5-lo
h JAtindad MAIl lenchaWge
L malueA h Ahn &yilnns.
MAdL
Udolakogucal llsuinclucll(Aala such
phypical ils
Fals Snapl Aa2Cemslo
6
NoInpuI 3
5
Outpub 1
3 6
10 15
Fl13
5
Wgnt Chart
D I
No awpuls
Dulpuls
S2
11
Lalomal
(unlreacrs
91
Atuat
Sinple =21 7
Cowola aFumeiow PoiT value a
d e m a i n h r a s l e n u c o
NCo - UCe inau : 3 2
No u bab= to
Lo ue 'imqiYi=24
NO laa ales tales = 2
e nal
Assma
Wat Compleriq asaton
aln Page6
Me
FP UEPx TCf then. FP
funelion loint UFP v ugte
a a uasjuttod fanaaon pbintE
amTfCbat+eebnicalCapisqG
ata a Di io do
inl e n r
h c e banameark a Copatad a
EP4x 37+hox54xto424Y+Yrz
UFP= 4*32 + o*5+2-4 * + 8* 1ot 7*2
TeF= o.65+O:DI *DI
DT= 4*3= y2
618 1 o)
= 661.2
n O S - T T . C
References
1. Roger S. Pressman, Software Engineering a Practitioner Approach, 3rd
Edition, TMH, 2005.
2. Rajib Mall, Fundamantal of Software Engineering, 3rd
Edition,PHI Publication, 2007.
3. Deepak Jain, Software Engineering for Practitioners, Ist
Edition, Oxford, 2012.
4. K K Agarwal and Yogesh Singh, Software Engineering, 3rd
Edition,Oxford, 2012.
********************
16

Contenu connexe

Tendances

Performance analysis and randamized agoritham
Performance analysis and randamized agorithamPerformance analysis and randamized agoritham
Performance analysis and randamized agoritham
lilyMalar1
 
Delphi cost estimation model
Delphi cost estimation modelDelphi cost estimation model
Delphi cost estimation model
Shashwat Shriparv
 
Lecture 3
Lecture 3Lecture 3
Lecture 3
Mr SMAK
 
Part I:Introduction to assembly language
Part I:Introduction to assembly languagePart I:Introduction to assembly language
Part I:Introduction to assembly language
Ahmed M. Abed
 

Tendances (20)

Phases of Compiler
Phases of CompilerPhases of Compiler
Phases of Compiler
 
Software metrics
Software metricsSoftware metrics
Software metrics
 
Performance analysis and randamized agoritham
Performance analysis and randamized agorithamPerformance analysis and randamized agoritham
Performance analysis and randamized agoritham
 
Run time storage
Run time storageRun time storage
Run time storage
 
Text Editor for System Software
Text Editor for System Software Text Editor for System Software
Text Editor for System Software
 
Compiler Chapter 1
Compiler Chapter 1Compiler Chapter 1
Compiler Chapter 1
 
NLP_KASHK:Minimum Edit Distance
NLP_KASHK:Minimum Edit DistanceNLP_KASHK:Minimum Edit Distance
NLP_KASHK:Minimum Edit Distance
 
Principal source of optimization in compiler design
Principal source of optimization in compiler designPrincipal source of optimization in compiler design
Principal source of optimization in compiler design
 
Phases of Compiler
Phases of CompilerPhases of Compiler
Phases of Compiler
 
Compiler design error handling
Compiler design error handlingCompiler design error handling
Compiler design error handling
 
Delphi cost estimation model
Delphi cost estimation modelDelphi cost estimation model
Delphi cost estimation model
 
VTU 4TH SEM CSE COMPUTER ORGANIZATION SOLVED PAPERS OF JUNE-2013 JUNE-2014 & ...
VTU 4TH SEM CSE COMPUTER ORGANIZATION SOLVED PAPERS OF JUNE-2013 JUNE-2014 & ...VTU 4TH SEM CSE COMPUTER ORGANIZATION SOLVED PAPERS OF JUNE-2013 JUNE-2014 & ...
VTU 4TH SEM CSE COMPUTER ORGANIZATION SOLVED PAPERS OF JUNE-2013 JUNE-2014 & ...
 
Lecture 3
Lecture 3Lecture 3
Lecture 3
 
Introduction to parallel computing
Introduction to parallel computingIntroduction to parallel computing
Introduction to parallel computing
 
Part I:Introduction to assembly language
Part I:Introduction to assembly languagePart I:Introduction to assembly language
Part I:Introduction to assembly language
 
Mpi.net tutorial
Mpi.net tutorialMpi.net tutorial
Mpi.net tutorial
 
Model Based Software Architectures
Model Based Software ArchitecturesModel Based Software Architectures
Model Based Software Architectures
 
4.3 techniques for turing machines construction
4.3 techniques for turing machines construction4.3 techniques for turing machines construction
4.3 techniques for turing machines construction
 
Black & White Box testing
Black & White Box testingBlack & White Box testing
Black & White Box testing
 
Aca11 bk2 ch9
Aca11 bk2 ch9Aca11 bk2 ch9
Aca11 bk2 ch9
 

Similaire à SE UNIT-3 (Software metrics).pdf

Oscar Nieves (11710858) Computational Physics Project - Inverted Pendulum
Oscar Nieves (11710858) Computational Physics Project - Inverted PendulumOscar Nieves (11710858) Computational Physics Project - Inverted Pendulum
Oscar Nieves (11710858) Computational Physics Project - Inverted Pendulum
Oscar Nieves
 
An Implementational approach to genetic algorithms for TSP
An Implementational approach to genetic algorithms for TSPAn Implementational approach to genetic algorithms for TSP
An Implementational approach to genetic algorithms for TSP
Sougata Das
 

Similaire à SE UNIT-3 (Software metrics).pdf (20)

41-Ranjit (p and I).pdf
41-Ranjit (p and I).pdf41-Ranjit (p and I).pdf
41-Ranjit (p and I).pdf
 
ECE2803 Electronic Workshop Lab Journal Online Classes
ECE2803 Electronic Workshop Lab Journal Online ClassesECE2803 Electronic Workshop Lab Journal Online Classes
ECE2803 Electronic Workshop Lab Journal Online Classes
 
Theory of algorithms final
Theory of algorithms final Theory of algorithms final
Theory of algorithms final
 
FinalReport
FinalReportFinalReport
FinalReport
 
derivatives math
derivatives mathderivatives math
derivatives math
 
Necla yucel ytu_muk_rapor
Necla yucel ytu_muk_raporNecla yucel ytu_muk_rapor
Necla yucel ytu_muk_rapor
 
Haar wavelet method for solving coupled system of fractional order partial d...
Haar wavelet method for solving coupled system of fractional  order partial d...Haar wavelet method for solving coupled system of fractional  order partial d...
Haar wavelet method for solving coupled system of fractional order partial d...
 
1,2. Dimensional Analysis and fluid .pptx
1,2. Dimensional Analysis and fluid .pptx1,2. Dimensional Analysis and fluid .pptx
1,2. Dimensional Analysis and fluid .pptx
 
multiscale_tutorial.pdf
multiscale_tutorial.pdfmultiscale_tutorial.pdf
multiscale_tutorial.pdf
 
JGrass-NewAge probabilities backward component
JGrass-NewAge probabilities backward component JGrass-NewAge probabilities backward component
JGrass-NewAge probabilities backward component
 
GEOframe-NewAge: documentation for probabilitiesbackward component
GEOframe-NewAge: documentation for probabilitiesbackward componentGEOframe-NewAge: documentation for probabilitiesbackward component
GEOframe-NewAge: documentation for probabilitiesbackward component
 
133501854 d-j-ewins-modal-testing-theory-and-practice
133501854 d-j-ewins-modal-testing-theory-and-practice133501854 d-j-ewins-modal-testing-theory-and-practice
133501854 d-j-ewins-modal-testing-theory-and-practice
 
Lecture 03 algorithm analysis
Lecture 03 algorithm analysisLecture 03 algorithm analysis
Lecture 03 algorithm analysis
 
Oscar Nieves (11710858) Computational Physics Project - Inverted Pendulum
Oscar Nieves (11710858) Computational Physics Project - Inverted PendulumOscar Nieves (11710858) Computational Physics Project - Inverted Pendulum
Oscar Nieves (11710858) Computational Physics Project - Inverted Pendulum
 
OPERATION RESEARCH_Cheat sheets.pdf
OPERATION RESEARCH_Cheat sheets.pdfOPERATION RESEARCH_Cheat sheets.pdf
OPERATION RESEARCH_Cheat sheets.pdf
 
An Evaluation Of Motor Models Of Handwriting
An Evaluation Of Motor Models Of HandwritingAn Evaluation Of Motor Models Of Handwriting
An Evaluation Of Motor Models Of Handwriting
 
Design of State Estimator for a Class of Generalized Chaotic Systems
Design of State Estimator for a Class of Generalized Chaotic SystemsDesign of State Estimator for a Class of Generalized Chaotic Systems
Design of State Estimator for a Class of Generalized Chaotic Systems
 
Lesson 11 1
Lesson 11  1Lesson 11  1
Lesson 11 1
 
An Implementational approach to genetic algorithms for TSP
An Implementational approach to genetic algorithms for TSPAn Implementational approach to genetic algorithms for TSP
An Implementational approach to genetic algorithms for TSP
 
unit-4.pdf
unit-4.pdfunit-4.pdf
unit-4.pdf
 

Plus de Dr. Radhey Shyam

SE-UNIT-3-II-Software metrics, numerical and their solutions.pdf
SE-UNIT-3-II-Software metrics, numerical and their solutions.pdfSE-UNIT-3-II-Software metrics, numerical and their solutions.pdf
SE-UNIT-3-II-Software metrics, numerical and their solutions.pdf
Dr. Radhey Shyam
 

Plus de Dr. Radhey Shyam (20)

KIT-601-L-UNIT-1 (Revised) Introduction to Data Analytcs.pdf
KIT-601-L-UNIT-1 (Revised) Introduction to Data Analytcs.pdfKIT-601-L-UNIT-1 (Revised) Introduction to Data Analytcs.pdf
KIT-601-L-UNIT-1 (Revised) Introduction to Data Analytcs.pdf
 
SE-UNIT-3-II-Software metrics, numerical and their solutions.pdf
SE-UNIT-3-II-Software metrics, numerical and their solutions.pdfSE-UNIT-3-II-Software metrics, numerical and their solutions.pdf
SE-UNIT-3-II-Software metrics, numerical and their solutions.pdf
 
Introduction to Data Analytics and data analytics life cycle
Introduction to Data Analytics and data analytics life cycleIntroduction to Data Analytics and data analytics life cycle
Introduction to Data Analytics and data analytics life cycle
 
KCS-501-3.pdf
KCS-501-3.pdfKCS-501-3.pdf
KCS-501-3.pdf
 
KIT-601 Lecture Notes-UNIT-2.pdf
KIT-601 Lecture Notes-UNIT-2.pdfKIT-601 Lecture Notes-UNIT-2.pdf
KIT-601 Lecture Notes-UNIT-2.pdf
 
KIT-601 Lecture Notes-UNIT-1.pdf
KIT-601 Lecture Notes-UNIT-1.pdfKIT-601 Lecture Notes-UNIT-1.pdf
KIT-601 Lecture Notes-UNIT-1.pdf
 
KCS-055 U5.pdf
KCS-055 U5.pdfKCS-055 U5.pdf
KCS-055 U5.pdf
 
KCS-055 MLT U4.pdf
KCS-055 MLT U4.pdfKCS-055 MLT U4.pdf
KCS-055 MLT U4.pdf
 
Deep-Learning-2017-Lecture5CNN.pptx
Deep-Learning-2017-Lecture5CNN.pptxDeep-Learning-2017-Lecture5CNN.pptx
Deep-Learning-2017-Lecture5CNN.pptx
 
SE UNIT-2.pdf
SE UNIT-2.pdfSE UNIT-2.pdf
SE UNIT-2.pdf
 
SE UNIT-1 Revised.pdf
SE UNIT-1 Revised.pdfSE UNIT-1 Revised.pdf
SE UNIT-1 Revised.pdf
 
SE UNIT-3.pdf
SE UNIT-3.pdfSE UNIT-3.pdf
SE UNIT-3.pdf
 
Ip unit 5
Ip unit 5Ip unit 5
Ip unit 5
 
Ip unit 4 modified on 22.06.21
Ip unit 4 modified on 22.06.21Ip unit 4 modified on 22.06.21
Ip unit 4 modified on 22.06.21
 
Ip unit 3 modified of 26.06.2021
Ip unit 3 modified of 26.06.2021Ip unit 3 modified of 26.06.2021
Ip unit 3 modified of 26.06.2021
 
Ip unit 2 modified on 8.6.2021
Ip unit 2 modified on 8.6.2021Ip unit 2 modified on 8.6.2021
Ip unit 2 modified on 8.6.2021
 
Ip unit 1
Ip unit 1Ip unit 1
Ip unit 1
 
Cc unit 5
Cc unit 5Cc unit 5
Cc unit 5
 
Cc unit 4 updated version
Cc unit 4 updated versionCc unit 4 updated version
Cc unit 4 updated version
 
Cc unit 3 updated version
Cc unit 3 updated versionCc unit 3 updated version
Cc unit 3 updated version
 

Dernier

electrical installation and maintenance.
electrical installation and maintenance.electrical installation and maintenance.
electrical installation and maintenance.
benjamincojr
 
Final DBMS Manual (2).pdf final lab manual
Final DBMS Manual (2).pdf final lab manualFinal DBMS Manual (2).pdf final lab manual
Final DBMS Manual (2).pdf final lab manual
BalamuruganV28
 
Tembisa Central Terminating Pills +27838792658 PHOMOLONG Top Abortion Pills F...
Tembisa Central Terminating Pills +27838792658 PHOMOLONG Top Abortion Pills F...Tembisa Central Terminating Pills +27838792658 PHOMOLONG Top Abortion Pills F...
Tembisa Central Terminating Pills +27838792658 PHOMOLONG Top Abortion Pills F...
drjose256
 
Artificial intelligence presentation2-171219131633.pdf
Artificial intelligence presentation2-171219131633.pdfArtificial intelligence presentation2-171219131633.pdf
Artificial intelligence presentation2-171219131633.pdf
Kira Dess
 

Dernier (20)

electrical installation and maintenance.
electrical installation and maintenance.electrical installation and maintenance.
electrical installation and maintenance.
 
8th International Conference on Soft Computing, Mathematics and Control (SMC ...
8th International Conference on Soft Computing, Mathematics and Control (SMC ...8th International Conference on Soft Computing, Mathematics and Control (SMC ...
8th International Conference on Soft Computing, Mathematics and Control (SMC ...
 
Raashid final report on Embedded Systems
Raashid final report on Embedded SystemsRaashid final report on Embedded Systems
Raashid final report on Embedded Systems
 
History of Indian Railways - the story of Growth & Modernization
History of Indian Railways - the story of Growth & ModernizationHistory of Indian Railways - the story of Growth & Modernization
History of Indian Railways - the story of Growth & Modernization
 
Passive Air Cooling System and Solar Water Heater.ppt
Passive Air Cooling System and Solar Water Heater.pptPassive Air Cooling System and Solar Water Heater.ppt
Passive Air Cooling System and Solar Water Heater.ppt
 
15-Minute City: A Completely New Horizon
15-Minute City: A Completely New Horizon15-Minute City: A Completely New Horizon
15-Minute City: A Completely New Horizon
 
UNIT-2 image enhancement.pdf Image Processing Unit 2 AKTU
UNIT-2 image enhancement.pdf Image Processing Unit 2 AKTUUNIT-2 image enhancement.pdf Image Processing Unit 2 AKTU
UNIT-2 image enhancement.pdf Image Processing Unit 2 AKTU
 
Final DBMS Manual (2).pdf final lab manual
Final DBMS Manual (2).pdf final lab manualFinal DBMS Manual (2).pdf final lab manual
Final DBMS Manual (2).pdf final lab manual
 
Tembisa Central Terminating Pills +27838792658 PHOMOLONG Top Abortion Pills F...
Tembisa Central Terminating Pills +27838792658 PHOMOLONG Top Abortion Pills F...Tembisa Central Terminating Pills +27838792658 PHOMOLONG Top Abortion Pills F...
Tembisa Central Terminating Pills +27838792658 PHOMOLONG Top Abortion Pills F...
 
Insurance management system project report.pdf
Insurance management system project report.pdfInsurance management system project report.pdf
Insurance management system project report.pdf
 
Autodesk Construction Cloud (Autodesk Build).pptx
Autodesk Construction Cloud (Autodesk Build).pptxAutodesk Construction Cloud (Autodesk Build).pptx
Autodesk Construction Cloud (Autodesk Build).pptx
 
Software Engineering Practical File Front Pages.pdf
Software Engineering Practical File Front Pages.pdfSoftware Engineering Practical File Front Pages.pdf
Software Engineering Practical File Front Pages.pdf
 
Circuit Breakers for Engineering Students
Circuit Breakers for Engineering StudentsCircuit Breakers for Engineering Students
Circuit Breakers for Engineering Students
 
Interfacing Analog to Digital Data Converters ee3404.pdf
Interfacing Analog to Digital Data Converters ee3404.pdfInterfacing Analog to Digital Data Converters ee3404.pdf
Interfacing Analog to Digital Data Converters ee3404.pdf
 
Seismic Hazard Assessment Software in Python by Prof. Dr. Costas Sachpazis
Seismic Hazard Assessment Software in Python by Prof. Dr. Costas SachpazisSeismic Hazard Assessment Software in Python by Prof. Dr. Costas Sachpazis
Seismic Hazard Assessment Software in Python by Prof. Dr. Costas Sachpazis
 
21scheme vtu syllabus of visveraya technological university
21scheme vtu syllabus of visveraya technological university21scheme vtu syllabus of visveraya technological university
21scheme vtu syllabus of visveraya technological university
 
What is Coordinate Measuring Machine? CMM Types, Features, Functions
What is Coordinate Measuring Machine? CMM Types, Features, FunctionsWhat is Coordinate Measuring Machine? CMM Types, Features, Functions
What is Coordinate Measuring Machine? CMM Types, Features, Functions
 
Artificial intelligence presentation2-171219131633.pdf
Artificial intelligence presentation2-171219131633.pdfArtificial intelligence presentation2-171219131633.pdf
Artificial intelligence presentation2-171219131633.pdf
 
Research Methodolgy & Intellectual Property Rights Series 1
Research Methodolgy & Intellectual Property Rights Series 1Research Methodolgy & Intellectual Property Rights Series 1
Research Methodolgy & Intellectual Property Rights Series 1
 
Artificial Intelligence in due diligence
Artificial Intelligence in due diligenceArtificial Intelligence in due diligence
Artificial Intelligence in due diligence
 

SE UNIT-3 (Software metrics).pdf

  • 1. Software Engineering (KCS-601) Unit-3 (Second Part): Software Metrics Dr. Radhey Shyam Professor Department of Computer Science and Engineering SRMCEM Lucknow (Affiliated to Dr. A.P.J. Abdul Kalam Technical University, Lucknow) Unit-3 (Second part) have been compiled/prepared by Dr. Radhey Shyam, with grateful acknowledgment who made their course contents freely available or (Contributed directly or indirectly). Feel free to use this study material for your own academic purposes. For any query, the communication can be made through this mail shyam0058@gmail.com. April 18, 2022
  • 2. Soktwahe Moi LAtuanr Meic o a e L ChaadTe ietis wi a guaru Cautalle Cturan m u u a d i i b l e tale Mtsics ane wpetat o n a n acens nelmdin Penomanee, lamm n w lomo M pmdutliwit, a mam tha uCea, Meacun n 7Maio ahe an imotant Coen ualt acsuramu Manasemot debus iming e ano mami a valnalle tr bth devlAare a denel mot am lendars, e n a dieren setw MaT O RLad sAtwane MDit eyelmdlic Cala funlow Poinh and LoC matrics, Cnebv
  • 3. FP and Loc bas elatinel LOT a g.nelia of Colo Course Name: M. Tech Halto AAsae sei C A aetaralt rdiclod wa t o u n Semester: 2nd Logk N, t N Paper Name: Object Oriented Software Engineering (MTCS-203B) 7 Topic: Halstead's Software Science. ocahulay7,f n wlam N Halstead's SoftwareScience Halstead's Software Science Halstead's complexity measurement was developed to measure a program module's complexiny directly from source code, with emphasis on computational complexity. The Halstead's measures are based on four scalar number derived directly from a program s source code: n 1S number of distinct operators. n2 is number of distinct operands. eurYante v Ni is total number of/distinct operators. N is total number ofdistinct operands From these numbers, five measures are derived: Measure Symbol Formula Program length N N=NI +Na Programvocabulary N n=nitn2 Volume V=N* (log2 n) Difficulty D D (n1/2)*(N2/2) Effort E E=D*V
  • 4. iaistead's uses certain measures such as program length, program vocabulary, v difficulty, and effort for the given algorithm. By this Halstead's is trying to show that une program length can be caleulated, volume of algorithm can be estimated. The above given table shows how actually these measure can be obtained. The Halstead's measures are applicable to operational system and to development eforts once the code has been written. Thus using Halstead's measurement experimental verification can be performed in software science. Program length: The length of a program is total usage of operators and operands in the program. Length (N) =Ni+N2 Program vocabulary: The Program vocabulary is the number of unique operators and operands used in the program. Vocabulary (n) = ni t n2 Program Volume: The Program Volume can be defined as minimum number of bits needed to encode the program. Volume (V) = N loga n Length estimation: N=ni log2 ni t n2 log2 n2 Guideline for caleulating operands and operators: 1. All the variables and constants are considered as operands. 2. Local variables with same name, if occurring in different functions are counted as unique operand. 3. Function calls are considered as operators.
  • 5. 4 The looping statements, do... while, while, for, are operators. The statements i, i else, are operators. The switch . . . case statements are considered as operators. 5. The reserve worlds, returns, default, continue, break, sizeof are all operators. 6. The brackets, commas, semicolons, are operators. 7. The unary and binary operators are considered as operators. The & is considered as operator. 8. In arrays, array name and index are considered as operands and [ ] is considered as operator. 9. All hash directives can be ignored. 10. Comments are not considered. 11. In Goto statement, goto is considered as operatorand label as operand. Example: Obtain Halstead's length and volume measure for following C function. ) (CtinatashengtE Void swap (int a[ ], int i) uelwme N n int temp; Fr Comptalia H a l s a r e l ' s m e bistineF eporators ) {Fi ne efperards; K 2 3 = -N=) Temp ali ail ali+1];: afi+1]=temp; legti N) = N,tNa=lct 17 pLabulayln)= n,#n2 = 8t4=12 N=10 We first find out the operands and operators from above function along with their occurrences. Operands Occurrences Operators Occurrences swap 5 void temp int 3
  • 6. 4 3 2 N-21 Na Caledali HaltEmdnpluma lo w # GCD lopuldio n geel (,1) n2=9 N 16 n=5 N=Ni+N: = 16+21 =37 rtile(= t) N=37 n =nitn2 = 5 +9 = 14 d -T- n= 14 Estimated length = n1 log ni + n2 log n2 = 5 iog 5 +9 log 93 . 1 1 = 5*2.32 +9*2.19 =31.37 GrpeTands eumemeas oralnd |aelunen Estimated length = 31.37 whde VolumeN * log n Y M 37 * log (14) d de 381 elu 37*2.63=97.64 3 Volume (V) = 97.64 3 33 13 2 n n,+) 3t13 - I6 2 NI = 14.Na 20 Estima longt = , t73 N= N+ N,= l4+20 = 3 Rume z 34x 6) 34x 136 3 3+ 13up13 3(1.58S)+ 13(3-)) =S2
  • 7. t le uaattalne Opelemalt lopleyi MeaswR t t mumos "k uneavy imdelouda Pacte e Cole. 'maidy u t e y a l u a t e Compay oa p ase ase mt ho Coployy Cn be lomleitad tngly f+low V(G)=e -n+2f He 'oth m t mo. des, and p T R na, 6 Cewwnaitd Comaemanb. 4) Hene Po e mo. TdCa o d e , (11 v(4)= No. agions &. Copul yelemue Cerkae us floin CL= e - nt2 = 8 1 0 CoReee e VG)=lo - 8+2 umda 2+2 4 e l c e (vC) 7. 1 V(G Monr aA me lemfpla (
  • 8. E a - l P i0 wtlCicn-1)d i+1: wil(i4 n) do Ai) 4A(1) Surp (ACi) AU i+1 e d. Compute eyelsnaiu abeue lnsrapy CLat v¢) o abe 9s.
  • 9. U N C T I O N POINT ystv la. mlboms, ap2, wobuts olusaluen m a m u m m ond m u n m u n , MLbucs a ptouclsup khimolio u a n s l i t Th peg.2el. soblesn and d l e r e l a f l A h b r B c l u c l MloLLLALL o u t a n d p o p u l e r 4 l u e r i m l l y b l u n g u L L d pund )Euncluafa peuul lo2einaleBge otes_LoC) Ladis a v a i l a k L _ t e L l h m a L L Thu m i l u c L a & L L k e R The TLpuettc_by c e u M l u s A M M A N A = SeLLAcLImLLlucluennlUn Ahe a l l / m e l u c i s d u a l o k n c d h e a s u a n W h u l l C c o i n L u s n g hl Ma imsluuciera, luaps_nedat_communluny th cOd AMd hindur/_lnsaKLA9mg/u Aoc hastkellewas)sherlcennin8 OC Loc a l u m l e u c a l ualue (e oc Jeblom e h a t saM May wrdily May wdaly dlfaluesmt ithindudkcal codin STyle.0 dfaUnen preisammusay wiÍAeAcOtelI.n dhfewnl wayllsFA Lg Om seavW paLeawm
  • 10. Reutal Bowmce mklnuub MnRAwhuak amathpp Lng M3uln a- LAMg{ acluos8 oC Aunlal kles aclun mLas _ol h codn 900d alsnl Om Th/ Dthn honmd, O 900d bupblum BheullK e DAUL COMMaleu Akplal llplmincdhd LA MUal L LLL9M CAde lhtll,Elc_am LoC hewluue ocuL Lh LAdng0clwly alrn CAAmLpAulus MUoky hs imalpiugMa_n ce lais_haoly lh Ahe aualils_amd liotmcys//EhL MIsauily( wnply kati auabtu highi ndy u lamalunes kurel Aannjual hughi L E N L L y _ heha th_doc coundwll Thsuweudd AhuA8a L m a l l p r R a M M A asglo2us8AuL_hr doCceu as measulee h lal pul un dllueml/deselghalus,_thy weula. a C o d e l u s e b l d u r l e b dis Vceunagm Page2-
  • 11. wUuy dllucull nal o p Alumali Jod/U Che accutal p. Che buob lemn A0Ccoul ca specAlca) OMA Cempuld 0nly bcemJullyfdevn Le mama9.eLS dusun hsotr.cl la amy hvelol, 4 e l CUMU-be/øm aclurty h a l s L l a s i l j d 6199.c8L th ZoC 0nelile h o t l c o r em he M A m a e b e n s p i C l u V peml melbuic Mluc houlceminIS umcEM. Funche boiint maMy m.gliuc LSuncids late 1970 'S uNcZien nta Aehulalpiy ueposkd_by ALbuchM h isnportamt aduamlojA3 Lt mcluen peun AMTLUc/ Au lhalt CaM LLnatl hiiac walp LeducZ LLclLcalue diuctly am he Vpuebi ncpiuo Lcaobihna ABCLCiy Page3 6
  • 12. A dapundemt Lu JumcluoLS gt h Asetwant oduct Supporlin lanfe . aluslksLwolLd S Lhama bsoclucl Lialuste ia ads some lasle Cdaumly tvnlh Qess no whna Lach dala amd Uan Siommsd LO he coHespondm? _eutpul mclon dala PumdernemtMetuc parammmlesus No f Ne uspil/s Na Na nalliius ales No:1- ntnlaces FP UFP * TCF Umoduslaol EumclueM Pomls Lechancal Compleaiy Facle TCF 0 65 0:01 X DL degLe imlluhace Dbndent M14paranmelsuswtuch A8gmid walue
  • 13. Lathocie )No S49milnul Imodlnla Moduroti OL N psLl No nm 5LStMgInlluim 4 Na Abuls ach data lum mpul by 2 No lpu Lach_Ldala lem eilput by hs p SNo LAAQLLIHILL No lduimcd intiuaclue quLrLLs hch caM 4No A Lhal (l Aapluus a ueup AoLucally uldltid 5-lo h JAtindad MAIl lenchaWge L malueA h Ahn &yilnns. MAdL Udolakogucal llsuinclucll(Aala such phypical ils Fals Snapl Aa2Cemslo 6 NoInpuI 3 5 Outpub 1 3 6 10 15 Fl13 5 Wgnt Chart
  • 14. D I No awpuls Dulpuls S2 11 Lalomal (unlreacrs 91 Atuat Sinple =21 7 Cowola aFumeiow PoiT value a d e m a i n h r a s l e n u c o NCo - UCe inau : 3 2 No u bab= to Lo ue 'imqiYi=24 NO laa ales tales = 2 e nal Assma Wat Compleriq asaton aln Page6 Me
  • 15. FP UEPx TCf then. FP funelion loint UFP v ugte a a uasjuttod fanaaon pbintE amTfCbat+eebnicalCapisqG ata a Di io do inl e n r h c e banameark a Copatad a EP4x 37+hox54xto424Y+Yrz UFP= 4*32 + o*5+2-4 * + 8* 1ot 7*2 TeF= o.65+O:DI *DI DT= 4*3= y2 618 1 o) = 661.2 n O S - T T . C
  • 16. References 1. Roger S. Pressman, Software Engineering a Practitioner Approach, 3rd Edition, TMH, 2005. 2. Rajib Mall, Fundamantal of Software Engineering, 3rd Edition,PHI Publication, 2007. 3. Deepak Jain, Software Engineering for Practitioners, Ist Edition, Oxford, 2012. 4. K K Agarwal and Yogesh Singh, Software Engineering, 3rd Edition,Oxford, 2012. ******************** 16