# /* vim: set filetype=awk : */ -*- awk -*- #This file was documented using references from the handout COCOMO II #Model Definition and http://sunset.usc.edu/research/COCOMOII/expert_cocomo #Estimate calculates the quotient result from dividing the person-month #calculation, pm(), by the amount of calendar time necessary to develop the #product, tdev(). function estimate() { staff = (months=pm())/(timE=tdev()); report(months,timE,staff); } #Size displays the overall size of the product. It is calculated from #the percentage of code discarded, revl(), the new source lines of code, #newsKsloc(), and the calculation of code reuse, equivalentKsloc(). function size() { return (1+(revl()/100)) *(newKsloc()+equivalentKsloc()); } #EquivalenKsloc is the calculation of code reuse. It is derived from the #size of the adapted component in thousands of adapted source lines of code, #adaptedKsloc(), the adaptation adjustment modifier, aam(), and the #percentage of code that is reengineered by automatic translation, at(). function equivalentKsloc() { return adaptedKsloc()*aam()*(1-(at()/100)); } #aam is the adaptation adjustment modifier that returns the result of one #of two calculations based on the value of the adaptation adjustment factor, #aaf(). aam is calculated from the degree of assessment and assimilation, #aa(), the adaptation adjustment factor, aaf(), the software understanding, #su(), and the programmer's unfamiliarity with the software, unfm(). #This function was changed from the original version that contained errors. function aam(f) { #Error! if ((f=aaf() <=50)) { if ((f=aaf()) <=50) { return (aa()+f*(1+(0.02*su()*unfm())))/100} #Error! else return (aa()+f*(su()*unfm())/100); } else return (aa()+f+(su()*unfm()))/100; } #aaf is the adaptation adjustment factor and is calculated using the percentage #of the adapted software's design that is modified, dm(), the percentage of #code modified, cm(), and the percentage of effort necessary to integrate #the reused software, im(). function aaf() { return 0.4*dm()+0.3*cm()+0.3*im(); } #scedPercent is the compression/expansion percentage in the sced effort #multiplier rating scale. These values reflect the rating scale from #Table 2.34, page 51 of the handout. This function was added to the original #version. function scedPercent(){ if (assume("sced")=="vl") return 75; if (assume("sced")=="l") return 85; if (assume("sced")=="n") return 100; if (assume("sced")=="h") return 130; if (assume("sced")=="vh") return 160;} #tdev is the amount of calendar time necessary to develop the product. It #is calculated using the constant c(), the amount of effort in person-months, #pmNs(), the exponent used in the tdev function, f(), and the compression/ #expansion percentage in the sced effort multiplier rating scale, #scedPercent(). function tdev(){ return (c()*(pmNs()^f()))*scedPercent()/100; } #f is the exponent used in the tdev function. It is calculated from the #constants d and b, and the scale exponent used in the pmNs function. function f() { return d()+0.2*(e()-b()); } #pm is the person-month calculation, the amount of time one person spends #working on the project for one month. It is calculated from the amount #of effort in person-months, pmNs(), the measure of the schedule constraint #for the project, sced(), and the estimated effort, pmAuto(). function pm() { return pmNs()*sced()+pmAuto(); } #pmNs is the amount of effort in person-months. pmNs is calculated from the #constant a(), size(), and the scale exponent, e(), and the following values: #Cost Drivers: #Product Factors: #rely: Required Software Reliability #data: Data Base Size #cplx: Product Complexity #ruse: Required Reusability #docu: Documentation Match to Life-Cycle Needs #Platform Factors: #time: Execution Time Constraint #stor: Main Storage Constraint #pvol: Platform Volatility #Personnel Factors: #acap: Analyst Capability #pcap: Programmer Capability #pcon: Personnel Continuity #apex: Applications Experience #plex: Platform Experience #ltex: Language and Tool Experience #Project Factors: #tool: Use of Software Tools #site: Multisite Development function pmNs() { return a()*(size()^e())* \ rely()*data()*cplx()* ruse()* \ docu()* time()*stor()* \ pvol()* acap()* pcap()* \ pcon()*apex()*plex()* \ ltex()*tool()*site(); } #e is the scale exponent used in the pmNs function. It calculated from #the constant b and the percent result of summing the selected scale #scale factors: #prec: Precedentedness #flex: Development Flexibility #resl: Architecture/Risk Resolution #team: Team Cohesion #pmat: Process Maturity function e() { return b()+0.01*(prec()+flex()+resl()+team()+pmat()); } #pmAuto is the estimated effort and is calculated from size of the adapted #component in thousands of adapted source lines of code, adaptedKsloc(), #the percentage of code that is reengineered by automatic translation, at(), #and the automatic translation productivity, atKProd(). function pmAuto() { return (adaptedKsloc()*(at()/100))/atKProd(); } #a,b,c and d are constants that reflect values from the 1983 and 2000 #calibrations. function a() {if (cocomo()==1983) {return 2.5} else {return 2.94}} function b() {if (cocomo()==2000) {return 0.91} else {return 1.01}} function c() {if (cocomo()==1983) {return 3.0 } else {return 3.67}} function d() {if (cocomo()==2000) {return 0.28} else {return 0.33}}