# INTRODUCTION he modern day software industry is all about efficiency. With the increase in the expanse and impact of modern day software projects, the need for accurate requirement analysis early in the software development phase has become pivotal. The provident allocation of the available resources and the judicious estimation of the essentials form the basis of any planning and scheduling activity. For a given set of requirements, it is desirable to cognize the amount of time and money required to deliver the project prolifically. The chief aim of software cost estimation is to enable the client and the developer to perform a costbenefit analysis. The software, the hardware and the human resources involved add up to the cost of a project. The cost / effort estimates are determined in terms of person-months (pm) which can be easily interchanged to actual currency cost. The basic input parameters for software cost estimation is size, measured in KDLOC ( Kilo Delivered Lines Of Code). A number of models have been evolved to establish the relation between Size and Effort [13]. The parameters of the algorithms are tuned using Genetic Algorithms [5], Fuzzy models [6] A common approach to the estimation of the software effort is by expressing it is as a single variable function of the project size. The equation of effort in terms of size is considered as follows: Effort= a * (Size) b (1) Where a, b are constants. The constants are usually determined by regression analysis applied to historical data. # b) Standard PSO with Inertia Weights In order to meet the needs of modern day problems several optimization techniques have come been introduced. When the search space is too large to search exhaustively, population based searches may be a good alternative, however, population based search techniques cannot guarantee you the optimal (best) solution. We will discuss a population based search technique, Particle Swarm Optimization (PSO) with Inertia Weights [Shi and Eberhart 1998]. Particle Swarm has two primary operators: Velocity update and Position update. During each generation each particle is accelerated toward the particles previous best position and the global best position. At each iteration a new velocity value for each particle is calculated based on its current velocity, the distance from its previous best position, and the distance from the global best position. The new velocity value is then used to calculate the next position of the particle in the search space. The inertia weight is multiplied by the previous velocity in the standard velocity equation and is linearly decreased throughout the run. This process is then iterated a set number of times or until a minimum error is achieved. The basic concept of PSO lies in accelerating each particle towards its Pbest and Gbest locations with regard to a random weighted acceleration at each time. The modifications of the particle's positions can be mathematically modeled by making use of the following equations: V i k+1 = w * V i k + c 1 * rand() 1 * (Pbest -S i k ) + c 2 * rand() 2 * (Gbest -S i k )(2)S i k+1 = S i k + V i k(3) Where, S i k is current search point, S i # THE STANDARD PSO WITH INERTIA WEIGHT FOR SOFTWARE EFFORT ESTIMATION The software effort is expressed as a function of a single variable of effort in terms of the project size as shown in equation-1. The parameters a, b are measured by using regression analysis applied to historical data. In order to tune these parameters we use the standard PSO with inertia weights. A nonzero inertia weight introduces a preference for the particle to continue moving in the same direction it was going on the previous iteration. Decreasing the inertia over time introduces a shift from the exploratory (global search) to the exploitative (local search) mode. The updating of weighting function is done with the following formula. W new = [( T mi -T ci ) * ( W iv -W fv ) ] / T mi + W fv(4) Where W new is new weight factor, T mi is the maxium numer of iteration specified, T ci is the current iteration number, W iv is the initial value of the weight, W fv is the final value of the weight. Empirical experiments have been performed with an inertia weight set to decrease linearly from 0.9 to 0.4 during the course of simulation. In the first experiment we keep the parameters c1 and c2 (weighting factors) fixed, while for the following experiment we change c1 and c2 (weighting factors) during subsequent iterations by employing the following equations [Rotnaweera, A. Halgamog S.K. and Watson H.C, 2004]. C 1 (t) = 2.5 -2 * (t / max_iter), which is the cognitive learning factor. ( )5 C 2 (t) = 0.5 + 2* (t / max_iter), which is the social coefficient. The particles are initialized with random position and velocity vectors the fitness function is evaluated and the Pbest and Gbest of all particles is found out. The particles adjust their velocity according to their Pbest and Gbest values. This process is repeated until the particles exhaust or some specified number of iterations takes place. The Gbest particle parameters at the end of the process are the resultant parameters. # III. # MODEL DESCRIPTION In this model we have considered "The standard PSO with inertia weights" with /without changing the weighting factors (c1, c2). PSO is a robust stochastic optimization technique based on the movement of swarms. This swarm behavior is used for tuning the parameters of the Cost/Effort estimation. As the PSO is a random weighted probabilistic model the previous benchmark data is required to tune the parameters, based on that data, swarms develop their intelligence and empower themselves to move towards the solution. The following is the methodology employed to tune the parameters in each proposed models following it. # a) METHODOLOGY (ALOGORITHM) Input: Size of Software Projects, Measured Efforts, Methodology (Effort Adjustment factor-EAF). Output: Optimized Parameters for Estimating Effort. The following is the methodology used to tune the parameters in the proposed models for Software Effort Estimation. Step 1: Initialize "n" particles with random positions P i and velocity vectors V i of tuning parameters .We also need the range of velocity between [-V max ,V max ]. The Initial positions of each particle are Personally Best for each Particle. Step 2: Initialize the weight function value w with 0.5 and weightening parameters cognitive learning factor c1, social coefficient c2 with 2.0. Step 3: Repeat the following steps 4 to 9 until number of iterations specified by the user or Particles Exhaust. Step 4: for i = 1,2, ???, n do // For all the Particles For each particle position with values of tuning parameters, evaluate the fitness function. The fitness function here is Mean Absolute Relative Error (MARE). The objective in this method is to minimize the MARE by selecting appropriate values from the ranges specified in step 1. Step 5: Here the Pbest is determined for each particle by evaluating and comparing measured effort and estimated effort values of the current and previous parameters values. If fitness (p) better than fitness (Pbest) then: Pbest = p. Step 6: Set the best of 'Pbests' as global best -Gbest. The particle value for which the variation between the estimated and measured effort is the least is chosen as the Gbest particle. Step 7: Update the weightening function is done by the following formula W new = [( T mi -T ci ) * ( W iv -W fv ) ] / T mi + W fv(7) Step 8: Update the weightening factors is done with the following equations for faster convergence. Step 9: Update the velocity and positions of the tuning parameters with the following equations for j = 1, 2, ????m do // For number of Parameters, our case m is 2or 3 or 4 begin V ji k+1 = w * V ji k + c 1 * rand() 1 * (Pbest -S ji k ) + c 2 * rand() 2 * (Gbest -S ji k )(10)S ji k+1 = S ji k + V ji k+1(11) end; Step 10: Give the Gbest values as the optimal solution. Step 11: Stop b) PROPOSED MODELS i. MODEL 1: A prefatory approach to estimating effort is to make it a function of a single variable , often this variable is project size measure in KDLOC ( kilo delivered lines of code) and the equation is given as , Effort = a (size) b Now in our model the parameters are tuned using above PSO methodology.The Update of velocity and positions of Parameter "a" is V ai k+1 = w * V ai k + c 1 * rand() 1 * (Pbest -S ai k ) + c 2 * rand() 2 * (Gbest -S ai k )(12) S ai k+1 = S ai k + V ai k+1 The Update of velocity and positions of Parameter "b" is V bi k+1 = w * V bi k + c 1 * rand() 1 * (Pbest -S bi k ) + c 2 * rand() 2 * (Gbest -S bi k ) S bi k+1 = S bi k + V bi k+1 Table 1 : Effort Multipliers ii. MODEL 2: Instead of having resources estimates as a function of one variable, resources estimates can depend on many different factors, giving rise to multivariable models. Such models are useful as they take into account the subtle aspects of each project such as their complexity or other such factors which usually create a non linearity. The cost factors considered are shown below. The product of all the above cost factors is the Effort Adjustment Factor (EAF).A model of this category starts with an initial estimate determined by using the strategic single variable model equations and adjusting the estimates based on other variable which is methodology. The equation is, Effort = a *(size) b + c* (ME). Where ME is the methodology used in the project. The parameters a, b, c are tuned by using above PSO methodology. The Update of velocity and positions of Parameter "a", "b" are shown in Model 1 and Parameter "c" is V ci k+1 = w * V ci k + c 1 * rand() 1 * (Pbest -S ci k ) + c 2 * rand() 2 * (Gbest -S ci k ) S ci k+1 = S ci k + V ci k+1 iii. MODEL 3 There are a lot of factors causing uncertainty and non linearity in the input parameters. In some projects the size is low while the methodology is high and the complexity is high, for other projects size is huge but the complexity is low. As per the above two models size and effort are directly proportional. But such a condition is not always satisfied giving rise to eccentric inputs. This can be accounted for by introducing a biasing factor (d). So the effort estimation equation is: The Update of velocity and positions of Parameter "a", "b", "c" are shown in Model 1,2 and Parameter "d" is V di k+1 = w * V di k + c 1 * rand() 1 * (Pbest -S di k ) + c 2 * rand() 2 * (Gbest -S di k ) S di k+1 = S di k + V di k+1 IV. # MODEL ANALYSIS a) Implementation We have implemented the above methodology for tuning parameters a,b,c and d in "C" language. For the parameter' a 'the velocities and positions of the Where ME represents Measured Effort, EE represents Estimated Effort. V. # MODEL EXPERIMENTATION # EXPERIMENT -1: For the study of these models we have taken data of 10 NASA [13] Table 2 : NASA software projects data By running the "C" implementation of the above methodology we obtain the following parameters for the proposed models. The following are the results obtained by running the above PSO algorithm implemented in "C" with changing weighting factors on each iteration. VI. # RESULTS AND DISCUSSIONS The following table shows estimated effort of our proposed model: EXPERIMENT -1: # CONCLUSION Software cost estimation is based on a probabilistic model and hence it does not generate exact values. However if good historical data is provided and a systematic technique is employed we can generate better results. Accuracy of the model is measured in terms of its error rate and it is desirable to be as close to the actual values as possible. In this study we have proposed new models to estimate the software effort. In order to tune the parameters we use particle swarm optimization methodology algorithm. It is observed that PSO gives more accurate results when juxtaposed with its other counterparts. On testing the performance of the model in terms of the MARE, VARE and VAF the results were found to be futile. These techniques can be applied to other software effort models. # Tad Gonsalves ![, Soft-Computing Techniques [7][9][10], Computational Intelligence Techniques[8],Heuristic Algorithms, Neural Networks, Radial Basis and Regression [11][12] . a) Basic Effort Model](image-2.png "") ![Effort = a *(size) b + c* (ME).+ d a,b,c,d parameters are tuned by using above PSO methodology.](image-3.png "") ![2011 Global Journals Inc. (US) Global Journal of Computer Science and Technology Volume XI Issue XVIII Version I 17 2011 October C 1 (t) = 2.5 -2 * (T ci / T mi )(8)C 2 (t) = 0.5 + 2* (T ci / T mi ),(9)constant. For the second experiment we changed the C1, C2 weighting factors by using equations 4 and 5.b) Performance MeasuresWe consider three performance criterions:1) Variance accounted -For(VAF) %VAF = ?1-var ?ME-EE? var (ME) ? × 100 2) Mean Absolute Relative Error %MARE= mean ? abs(ME-EE) (ME) ? ×100 3) Variance Absolute Relative Error (VARE) %VARE= var ? abs(ME-EE) (ME) ? ×100](image-4.png "©") 1![a=2.646251 and b=0.857612 . The range of a is [1, 10] and b is [-5,5] . Model 2: a=2.771722, b=0.847952 and c= -0.007171. The range of a is [1, 10], b is [-5,5] and c is [-1,1]. Model 3: a =3.131606, b=0.820175, c=0.045208 and d= -2.020790. The ranges are a[1,10],b[-5,5], c[-1,1] and EXPERIMENT -2:](image-5.png "Model 1 :") 3Fig 1 : Measured Effort Vs Estimated Efforts ofProposed ModelsCOMPARISON WITH OTHER MODELSRefer Table 4 for the comparison with other models. 2011October18ProjectSize InMethodologyMeasuredNoKDLOC(ME)Effort132.1285103.1267114.21991712.52723.9346.51979454.52090.8667.52998.41578.63598.7190.230115.818100.834138.3 5 Techniques", 2008 IEEE Congress on Evolutionary, Atsushi Ito, Ryo Kawabata and Kiyoshi Itoh , Swarm Intelligence in the Optimization of Software Development Project Schedule, 0730-Computation (CEC 2008), 978-1-4244-1823-7/08CASE-IIMODEL-III5.0000013157/08 , 2008 IEEE. 8. J.S.Pahariya ,V. Ravi, M. Carr, Software Cost Estimation using Computational Intelligence Techniques,2009 World Congress on Nature &CASE-IIMODEL-II5.502722Biologically Inspired Computing (NaBIC 2009).9. 20 2011 OctoberInternational Journal of Software Engineering, IJSE Vol.3 Table 4 : Measured Efforts of Various ModelsModel 2 Harish Alaa F. Sheta model1 Estimate Harish model2 CASE-I MODEL-I CASE-I MODEL-II CASE-I MODEL-III CASE-II MODEL-I11.271 6.357 4.257 5.000002 4.998887 5.000007 5.000002Alaa F. hetaG.E.ModelEstimate8.44Bailey-BasiliEstimate7.226Measured effort57© 2011 Global Journals Inc. (US) © 2011 Global Journals Inc. (US) Global Journal of Computer Science and Technology Volume XI Issue XVIII Version I 16 2011 October Software Effort Estimation Using Particle Swarm Optimization with Inertia Weight © 2011 Global Journals Inc. (US) . Software Effort Estimation Using Particle Swarm Optimization with Inertia Weight * Genetic Algorithms in Search, Optimization and Machine Learning DEGoldberg 1989 Addison-Wesley * Multi-Objective Optimization Using Evolutionary Algorithms KDeb 2002 John Wiley and Sons * Evolutionary Algorithms for Solving Multi-Objective Problems CACoello Coello 2002 Kluwer * Elitist Multi evolutionary algorithm for environmental/economic dispatch TFRobert AhKing CSHarry Rughooputh 2003 IEEE * Estimation of the COCOMO Model Parameters Using Genetic Algorithms for NASA Software Projects AlaaFSheta Journal of Computer Science 1549-36362006 2 2 * Development of Software Effort and Schedule Estimation Models Using Soft Computing AlaaSheta DavidRine AladdinAyesh