ISBN : 978-81-963532-2-3 (E-Book) 2 1 1 2 1 22 = ηlogη+ ηlogη 2 22 Experimental evidence gathered from the analysis of larger number of programs suggests that thecomputed and actual lengths match very closely. However, the results may be inaccurate whensmallprograms when considered individually. In conclusion, Halstead’s theory tries to provide a formal definition and quantification of suchqualitative attributes as program complexity, ease of understanding, and the level of abstractionbasedonsomelowlevelparameterssuchasthenumberofoperands,andoperatorsappearingin theprogram.Halstead’ssoftwarescienceprovidesgrossestimationofpropertiesofalargecollectionofsoftw are, but extendsto individual cases ratherinaccurately. Example: LetusconsiderthefollowingCprogram: main() { inta, b, c, avg; scanf(“%d%d%d”,&a,&b,&c);av g= (a+b+c)/3; printf(“avg=%d”, avg); } Theunique operators are: main,(),{},int,scanf,&,“,”,“;”,=,+,/,printf Theuniqueoperandsare: a, b, c, &a, &b, &c, a+b+c, avg, 3,“%d%d%d”,“avg =%d” Therefore, η= 12, η= 11 1 2 Estimated Length =(12*log12+11*log11) =(12*3.58 + 11*3.45) =(43+38) = 81 160 Software Engineering Keerthana P, Manasa KN, Ganga D Bengal
166 Publizr Home