Bayesian Regularization in a Neural Network Model to Estimate Lines of Code Using Function Points

: It is a well known fact that at the beginning of any project, the software industry needs to know, how much will it cost to develop and what would be the time required ? . This paper examines the potential of using a neural network model for estimating the lines of code, once the functional requirements are known. Using the International Software Benchmarking Standards Group (ISBSG) Repository Data (release 9) for the experiment, this paper examines the performance of back propagation feed forward neural network to estimate the Source Lines of Code. Multiple training algorithms are used in the experiments. Results demonstrate that the neural network models trained using Bayesian Regularization provide the best results and are suitable for this purpose.


INTRODUCTION
The estimation of resource expenditure (example, effort, schedule ) is an essential software project management activity.
Software development involves a number of interrelated factors which can affect development effort and time and it is a complex dynamic process.
It is a challenge to estimate the lines of code for the project during the early stages of project as very little is known about the problem. Several researchers have suggested various techniques to predict software effort namely model based (SLIM, COCOMO Checkpoint), Expert based ( Delphi) , Regression based etc. The latest of these techniques are machine learning techniques. There are a number of approaches [1,2,3] to machine learning namely Neural Networks, Fuzzy Logic, Case Based Reasoning and Hybrid Systems. Many researchers [6][7][8][9] have explored the possibility of using Neural Networks for estimating the effort. Neuro Fuzzy models [10] have also been explored and they are found to be useful in software estimation. This paper focuses on using a neural network to predict the lines of code when the function point, the FP standard used, the language one is going to use and the maximum team size is known. The ISBSG repository that is available for a number of projects is used to prove that neural networks are indeed suitable for this purpose. It also examines which training algorithm is best suited for the purpose.
Artificial neural networks: Artificial neural networks can model complex non-linear relationships and approximate any measurable function. They can be used as an effective tool for pattern classification and clustering [11,12] .
They are particularly useful in problems where there is a complex relationship between an input and output. It has been established that a one hidden layer feedforward network with (sufficient number of) sigmoidal nodes can approximate any continuous mapping with arbitrary precision [13][14][15][16] . The feed forward multi layer network is a network in which no loops occur in the network path. A learning rule is defined as a procedure for modifying the weight and biases of a network with the objective of minimizing the mismatch between the desired output and the obtained output from the network for any given input. The learning rule / network training algorithm is used to adjust the weights and biases of the network in order to move the network outputs close to the targets. The classical backpropagation algorithm was the first training algorithm developed [17] .
The simplest implementation of backpropagation learning updates the network weights and biases in the direction in which the performance function decreases most rapidly -the negative of the gradient [17] though second order optimization algorithms like the conjugate gradient, the Levenberg-Marquardt and Baysian learning algorithms have also been developed. In this paper, a four input and one output network is used. The network uses only one hidden layer. The activation functions at the hidden layer and the output layers are the tangent -hyperbolic (tanh) function. The network inputs are (a) The function point count for projects, (b) the team size, (c) the level of the language used in development and (d) the function point standard. The block diagram of the network used is shown in Fig. 1. Figure 1 shows a model whose inputs are function points, language used, FP standard and maximum team size. The output (target) is lines of code. Neural Network model for estimating lines of code: The project data used was that of International Software Benchmarking Standards Group (ISBSG) repository data (release 9). Out of the various fields available, the following fields were used as inputs.

Project ID: This was used for identifying projects
Functions points: The function points count for that particular project. Language: This defines the language type used for the project e.g. 3GL, 4GL, Application Generator etc.

Lines of code:
The number of the source line of code (SLOC) produced by the project. This is not available for all projects.
Since SLOC is not available for all projects , only those projects were considered for the experiment where SLOC data was available . This lead to a data set of 88 projects.

MATERIALS AND METHODS
The function point count, function point standard, language used a nd maximum team size were used as inputs. Outliers were removed from all data sets. The function point data was normalized by linear scaling between -1 and 1. The FP standard was coded as shown in table I and the language used, was coded as shown in Table 2.
Since there was only one data POINT pertaining to 5 GL that was dropped. All data variables are scaled in the range -1 to 1.  The neural network used a sigmoid feed forward network with a single hidden layer using the neural network tool for of MATLAB. Seventy one exemplars were used for training with SLOC as the target. The neurons in the hidden layer were varied from five to sixteen. It was found that the ensemble with fifteen neurons in the hidden layer yielded best results.
Thus there are four nodes in the input layer, fifteen neurons in the hidden layer and one node in the output layer. The MATLAB adaptation learning function selected for this experiment was 'learngdm, the performance function used was mean square error (MSE). Transfer functions used were, tangenthyperbolic in both the hidden and the output layers. The goal was kept as 0.00(though it was never achieved, but a goal of 10 -16 was reached which is as good as 0.)The no. of epochs was kept as 1000. After training, testing was done on the network from the data set of seventeen projects. Random partioning was done to form three sets of training and test data. After training, testing was done and the output obtained were compared with the target values. In this case we obtained seventy one training cases and seventeen test cases in every set. The objectives of the experiments were twofold: * To verify if neural networks can be used for prediction of SLOC counts on the basis of Function Points, team size, function point standard and language type used in development. * To empirically evaluate the training algorithms and to find which training algorithm is suitable for the estimation purpose. * The experiment was conducted using the same neural network but using different algorithms as shown in Table  After performing the same experiment with different algorithms, the results are compared in the next section.
Error measurements: Different error measurements have been used by various researchers. We have chosen the mean absolute Percentage Error(MAPE) MAPE is calculated as follows [7]   (1) If MAPE is small, the better is the model and the predictions are a good set of predictions. The Correlation Coefficient (r). or correlation coefficient for short is a measure of the degree of linear relationship between two variables. The correlation coefficient may take on any value between plus and minus one Significance of Correlations.(sig). The significance level calculated for each correlation is a primary source of information about the reliability of the correlation Standard Deviation.(std.). The standard deviation (this term was first used by Pearson, 1894) is a commonly-used measure of variation. The standard deviation of a population of values is computed as: where: µ is the population mean N is the population size.

RESULTS AND DISCUSSION
The results using various training algorithms are as shown in Table 4. Results demonstrate that train br algorithm can be rated as the best. average MAPE in this case is 14.65, average co-relation is 0.64 and average significance is 0.99 . train gd algorithm can be rated as the next best one with average mape as 16.36, average co-relation as 0.28 and average significance as 0.62.these are followed by train rp algorithm with average values of MAPE, co-relation and significance being 16.89, 0.49 and 0.90 respectively. The plots of actual SLOC and predicted SLOC for various test projects using the train br algorithm for three runs are as shown in Fig. 2  Future scope: The neural network model used here could further be extended to a neural fuzzy model being trained and tested for the same ISBSG data ( Release 9). There is a possibility that this model could be a better model.

CONCLUSION
In the present work, the possibility of use of neural networks for estimating lines of code for software project was explored. The ISBSG Data(Realease 9) , was used to train and test the neural network.
It is concluded from experimental work the neural networks can be very well used for estimating the lines of code once the function point count is known. Also it is concluded that the train br algorithm yields the best results.