You are on page 1of 10

IJITMR

Vol.5 No.2 July-December 2013, pp.54-63 Serials Publications, (India)

A Hybrid Classifier approach for Software Fault Prediction


C. Akalya Devi1 and B. Surendiran2 Assistant Professor, Department of Information Technology, PSG College of Technology, Coimbatore, India. 2 Associate Professor (Sr. Gr), Department of Information Technology, Info Institute of Engineering, Coimbatore, India. Email:-akalya.jk@gmail.com, surendir@gmail.com
1

Abstract:-Software fault prediction is the process of identifying the faulty modules in software, which plays a major role in the quality of the software. In this paper a hybrid classifier is proposed for software fault prediction. This proposed hybrid classifier is a combination of Linear Discriminant Analysis (LDA) and Neural Network (NN). NASAs public datasets KC1 and PC1 available at promise software engineering repository are used to test the proposed model. Here apart from the existing features of the dataset, LDA score is introduced as an additional feature for the neural network classifier. The proposed hybrid classifier LDA-NN shows improvement in accuracy of prediction, which plays a vital role to improve the quality of soft wares in future. Keywords:-Fault prediction, LDA, NN, software fault, software quality

1. INTRODUCTION Quality of the software is an important aspect and software fault prediction helps to better concentrate on faulty modules. A fault is a mistake in the coding of the software which makes the software to behave in an abnormal way and in the way it is expected to behave. And software fault prediction is to identify the modules most likely to have the faults. Software failures no only results in heavy loss of cash and to the worst human lives too in critical systems. In this modern world software is everywhere like air which we use all the day. Right from a bus ticket to Intensive care unit or anything is of softwares. Softwares are developed by humans who are error prone by mistake or either by un-noticed basic requirements. And for complex softwares Software Reliability is hard to archive. To predict the faults techniques like statistical methods, machine learning methods, parametric models and mixed algorithms are used. Supervised machine learning technique is a method in which input and output in hand is used to train the machine to better predict in future. Metrics datasets KC1 and PC1 available at promise repository is used for the experiments [1]. In the proposed model additional feature (LDA score) is used. This model better predicts the fault than the grey features. 2. LITERATURE REVIEW Software crisis is the difficulty involved in delivering software within budget, on time and of good quality. These three aspects are very important for a software company to survive. At the same time maintenance cost [4] has been increasing from 75 percent in late 1980s and 90 percent in early 1990s. And also over 50 percent of programmer effort is spent for maintenance alone [5]. Developing quality software is an important factor and hence this is an attractive area for many researchers. Predicting whether software contains defective modules is not only useful for future versions of large software but will also be helpful while developing similar projects [6]. [7] introduced maintenance severity which would help to locate the modules that need attention and their precision model showed 70% accuracy for KC1 dataset. Statistical, machine learning, and mixed techniques are widely used in the literature to predict software defects. [8, 9] shows that reducing the number of independent factors (attribute set) does not significantly affect the Accuracy value in software quality prediction. In [10] compared decision trees, nave Bayes, and 1-rule classifier on the NASA software defect data. A clear trend was not observed and different predictors scored better on different data sets. However, their proposed ROCKY classifier outscored all the above predictor models. [11] compared different case-based reasoning classifiers and concluded that there is no added advantage in varying the combination of parameters (including varying nearest neighbour and using different weight functions) of the classifier to make the prediction Accuracy better. Bayesian Belief Networks, Causal Probabilistic Networks, casual Nets, Graphical Probability Networks, Probabilistic Cause- Effect Models, and Probabilistic Influence Diagrams [12] have attracted much recent
54

IJITMR
Vol.5 No.2 July-December 2013, pp.54-63 Serials Publications, (India)

attention as a possible solution for the problems of decision support under uncertainty with the help of data mining tools available. Many modelling techniques have been developed and applied for software quality prediction. These include logistic regression, discriminant analysis [13, 14], the discriminative power techniques, Optimized Set Reduction, artificial neural network [15, 16], fuzzy classification Bayesian Belief Networks (Fenton & Neil, 1999), recently Dempster-Shafer Belief Networks. It is clear that not a single model is enough for better prediction. 3. DATASET Data sets used here for the evaluation of hybrid classifier are KC1and PC1 NASA data sets from promise software engineering repository [1]. KC1 is a C++" system implementing storage management for receiving and processing ground data. It has a total of 2109 modules with 326 defective instances. And PC1 (written in C), is an earth orbiting satellite system containing 1109 modules with 79 defective instances. The following table1 depicts the source code metrics of KC1 and PC1 datasets. Out of 22 attributes defects is the boolean variable which says whether the module contains defects or not. Table 1.List of Kc1 Dataset Attributes loc McCabe's line count of code v(g) McCabe "cyclomatic complexity" ev(g) McCabe "essential complexity" iv(g) McCabe "design complexity" N Halstead total operators + operands V Halstead "volume" L Halstead "program length" T Halstead's time estimator d Halstead "difficulty" i Halstead "intelligence" e Halstead "effort" B Halstead's "error estimate" lOCode Halstead's line count lOComment Halstead's count of lines of comments lOBlank Halstead's count of blank lines locCodeAndComment Total lines of Code And Comment uniq_Op unique operators uniq_Opnd unique operands total_Op total operators total_Opnd total operands branchCount of the flow graph defects {false,true} {false,true}module has/has not one or more reported defects

1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22.

loc: This metric describes the total number of lines for a given module. This is the sum of the executable lines and the commented lines of code and blank lines. Pure, simple count from open bracket to close bracket and includes every line in between, regardless of character content. v(g): Cyclomatic Complexity(v(g)), measures the number of "linearly independent paths". A set of paths is said to be linearly independent if no path in the set is a linear combination of any other paths in the set through a program's "flow graph". A flow graph is a directed graph where each node corresponds to a program statement, and each arc indicates the flow of control from one statement to another. v(g) is calculated by, v(g) = e - n + 2 (1)

where "g" is a program's flow graph, "e" is the number of arcs in the flow graph, and "n" is the number of nodes in the flow graph. The standard McCabes rules ("v(g)">10), are used to identify fault-prone module.
55

IJITMR
Vol.5 No.2 July-December 2013, pp.54-63 Serials Publications, (India)

ev(g): Essential Complexity(ev(g)) is the extent to which a flow graph can be reduced by decomposing all the sub-flow graphs of g that are "D-structured primes". Such "D-structured primes" are also sometimes referred to as "proper one-entry one-exit sub-flow graphs [1]. ev(G) is calculated using, ev(g)= v(g) m where "m" is the number of sub-flow graphs of "g" that are D-structured primes. iv(g): Design Complexity(iv(g)), is the Cyclomatic complexity of a module's reduced flow graph. The flow graph, "g", of a module is reduced to eliminate any complexity which does not influence the interrelationship between design modules. According to McCabe, this complexity measurement reflects the modules calling patterns to its immediate subordinate modules. N: This metric describes the Halstead total operators + operands. V: This metric describes the halstead (V) metric of a module that contains the minimum number of bits required for coding the program. L: This metric describes the halstead level (L) metric of a module i.e. level at which the program can be understood. T: This metric describes the halstead programming time metric of a module. It is the estimated amount of time to implement the algorithm. d: The difficulty level or error proneness (d) of the program is proportional to the number of unique operators in the program. i: Intelligence(i) shows the complexity of a given algorithm independent of the language used to express the algorithm. The intelligence Content determines how much is said in a program. e: This metric describes the halstead effort (e) metric of a module. Effort is the number of mental discriminations required to implement the program and also the effort required to read and understand the program. B: This metric describes the halstead error estimate metric of a module. It is an estimate for the number of errors in the implementation. lOCode: The number of lines of executable code for a module. This includes all lines of code that are not fully commented. lOComment: This metric describes the number of lines of comments in a module. lOBlank: Halstead's count of blank lines. locCodeAndComment: This metric describes the number of lines which contain both code & comment in a module. uniq_Op: This metric describes the number of unique operators contained in a module i.e. the number of distinct operators in a module. uniq_Opnd: This metric describes the number of unique operands contained in a module. It is a count of unique variables and constants in a module. total_Op: This metric describes the total usage of all the operators. total_Opnd: This metric describes the total usage of all the operands. branchCount: It describes the number of decision points in a given module. Decisions are caused by conditionals statements. defects: It describes weather the particular module is defective or not. This attribute is used for prediction. 4. HYBRID CLASSIFIER MODEL Hybrid classifier [17] (LDA-NN) approach is the combination of Liner Discriminant Analysis (LDA) and neural network (NN) classifiers. Discriminant score plays the role of an additional feature to classify defective modules. Proposed hybrid classifier for software fault prediction is shown in the fig.1. (2)

56

IJITMR
Vol.5 No.2 July-December 2013, pp.54-63 Serials Publications, (India)

Figure 1. Hybrid Classifier model for Software fault prediction 4.1. LDA Classifier LDA Score is a linear combination of features. Linear discriminant analysis (LDA) classifier is used to get a LDA score which is used as an additional feature for NN Classifier. SPSS Package is used for applying LDA. The standardized canonical coefficients for each of the features for PC1 and KC1 datasets are shown in the tables 2 and 4. The LDA score is calculated for each module by using the Canonical Discriminant Function Coefficients and the feature values for each module by using the following equation, LDA score = f1 x c1 + f2 x c1 + + fn x cn + constant Table 2. Canonical Discriminant Function Coefficients for PC1 Dataset Function Attribute 1 loc .104 v(g) .025 ev(g) -.009 iv(G) -.057 N .010 V -.003 L 1.622 D -.039 I -.010 E .000 B 2.720 lOCode -.106 lOComment .016 lOBlank .014 uniq_Op .030 uniq_Opnd .060 total_Op .002 branchCount -.023 (Constant) -1.001 (3)

57

IJITMR
Vol.5 No.2 July-December 2013, pp.54-63 Serials Publications, (India)

defects

Table 3.Classification Accuracy forPC1 Dataset Predicted Group Membership Total 0 1016 57 98.4 74.0 1 16 20 1.6 26.0 1032 77 100.0 100.0

Original

Count

0 1

0 1

93.4% of original grouped cases correctly classified. For example, for PC1 Dataset the above equation can be written as follows by using the values in table 3 and 4 as, LDA score = loc x .104 + v(g) x 0.025 + . + branchCount x (-.023) + -1.001 (4)

This LDA score classifies a module as faulty or non-faulty modules based on the LDA score is positive or negative value respectively. 21 features for PC1 dataset produce an accuracy of 93.4% and for KC1 it is 86.3% and is shown in table 3 and table 5. Table 4. Canonical Discriminant Function Coefficients KC1 Dataset Function Attribute 1 loc .023 v(g) -.498 ev(g) -.086 iv(g) .306 n -.053 v .004 l -.227 d .205 i .019 e .000 b 3.139 lOCode -.039 lOComment .034 lOBlank .011 locCodeAndComment -.467 uniq_Op -.035 uniq_Opnd .036 total_Opnd .049 branchCount .094 (Constant) -.795

58

IJITMR
Vol.5 No.2 July-December 2013, pp.54-63 Serials Publications, (India)

defects

Table 5 Classification Accuracy for KC1 Dataset Predicted Group Membership Total 0 1720 225 96.5 69.0 1 63 101 3.5 31.0 1783 326 100.0 100.0 Original Count 0 1 % 0 1 86.3% of original grouped cases correctly classified. 4.2 NN Classifier Neural Network classifier performs well for large parameters [18]. PASW modeler is used for NN classifier and for developing the hybrid classifier model. The classification Accuracy is 94.054% for PC1 and 86.782% for KC1 dataset. 5. EXPERIMENTAL RESULTS AND ANALYSIS The hybrid LDA-NN classifier is shown in the fig 4. In this model LDA score is used as an additional feature along with 21 features for classification. The results are shown in the table 6 and it is clear that LDA score is playing a significant form in classifying faulty and non-faulty modules. LDA score has high importance in classification accuracy and is clear from the observation as shown in fig 6 and 8 forPC1 and KC1 datasets. The dataset is split into 70/30 for training and testing. The hybrid LDA-NN classifier has a higher classification accuracy of 99.216% for PC1 and 96.944% in case of KC1 dataset.

Figure 4.Hybrid Classifier model for Software fault prediction in PASW modeler

59

IJITMR
Vol.5 No.2 July-December 2013, pp.54-63 Serials Publications, (India)

Figure 5.LDA-NN Classification Accuracy for 70/30 split PC1 Dataset

Figure 6.Variable Importance chart for PC1Dataset

60

IJITMR
Vol.5 No.2 July-December 2013, pp.54-63 Serials Publications, (India)

Figure 7.LDA-NN Classification Accuracy for 70/30 split KC1 Dataset

Figure 8.Variable Importance chart for KC1Dataset Table 6.Comparison of Classifiers Accuracy Classification No. of Accuracy (%) Classifier features PC1 KC1 LDA NN LDA-NN 21 21 22 93.4 94.054 99.216 86.3 86.782 96.944

61

IJITMR
Vol.5 No.2 July-December 2013, pp.54-63 Serials Publications, (India)

100 95 90 PC1 85 80 75 LDA NN LDA-NN KC1

Figure 9.Classification Accuracy Comparison 6. CONCLUSION Comparison of results shows that hybrid classifier gives better performance. Hybrid classifier approach combines power of both statistical and neural network classifiers. Discriminant score is an effective measure to classify defective modules. This prediction model helps to pay more attention to fault prone modules in a project and also in future. Better prediction improves quality and also leads to easy maintenance. REFERENCES 1. The PROMISE Repository of Software Engineering Databases. Available: http://promise.site.uottawa.ca/SERepository 2. Kung, H. and C. Hsu, 1998. Software Maintenance Life Cycle Model. Proceedings International Conference on Software Maintenance, IEEE 1998, Washington D.C.etrics, pp: 203-214. 3. Hsiang-Jui, Kung, 2004. Quantitative Method to Determine Software Maintenance Life Cycle. Proceedings of the 20th IEEE International Conference on Software Maintenance, IEEE, 2004. 4. Pigoski, T. M., 1997. Practical Software Maintenance. Wiley computer publishing, 1997. 5. Gibson, V. and J. Senn, 1989. System Structure and Software Maintenance Performance. Comm. Of ACM, 27(3): 347-358. 6. Khoshgoftaar, T. M., E. B. Allen, F. D. Ross, R. Munikoti, N. Goel, and A. Nandi, 1997. Predicting faultprone modules with case-based reasoning. ISSRE-1997 the Eighth International Symposium on Software Engineering IEEE Computer Society, pp: 27-35. 7. Parvinder Singh Sandhu, Sunil Kumar and Hardeep Singh, (2007) "Intelligence System for Software Maintenance Severity Prediction", Journal of Computer Science 3 (5): 281-288, 2007, ISSN 1549-3636, Science Publications. 8. Khoshgoftaar, T.M., K. Gao and R. M. Szabo, 2001. An Application of Zero-Inflated Poisson Regression for Software Fault Prediction. Software Reliability Engineering, ISSRE 2001. Proceedings of 12th International Symposium on, 27-30 Nov. (2001), pp: 66 -73. 9. Munson, J. and T. Khoshgoftaar, 1990. Regression Modeling of Software Quality: An Empirical Investigation. Information and Software Technology, 32(2): 106 - 114. 10. Khoshgoftaar, T. M. and J. C. Munson, 1990. Predicting Software Development Errors using Complexity Metrics. IEEE Journal on Selected Areas in Communications, 8(2): 253 -261. 11. Menzies, T., K. Ammar, A. Nikora, and S. Stefano, 2003. How Simple is Software Defect Prediction? Journal of Empirical Software Engineering, October (2003). 12. Eman, K., S. Benlarbi, N. Goel and S. Rai, 2001. Comparing case-based reasoning classifiers for predicting high risk software components. Journal of Systems Software, 55(3): 301 310. 13. Fenton, N.E. and M. Neil, 1999. A critique of software defect prediction models. IEEE Trans. On Software Engineering, 25(5): 675 -689. 14. Hudepohl, J. P., S. J. Aud, T. M. Khoshgoftaar, E. B. Allen, and J. E. Mayrand, 1996. Software Metrics and Models on the Desktop. IEEE Software, 13(5): 56-60. 15. Khoshgoftaar, T. M., E. B. Allen, K. S. Kalaichelvan, and N. Goel, 1996. Early quality prediction: a case study in telecommunications. IEEE Software (1996), 13(1): 65-71.
62

IJITMR
Vol.5 No.2 July-December 2013, pp.54-63 Serials Publications, (India)

16. Khoshgoftaar, T. M. and N. Seliya, 2002. Treebased software quality estimation models for fault prediction. METRICS 2002, the Eighth IIIE Symposium on Software Metrics, pp: 203-214. 17. Surendiran, B. and Vadivel, A. (2011) A hybrid classifier for mammogram mass classification using various new geometric shape and margin features, Int. J. Rapid Manufacturing, Vol. 2, Nos. 1/2, pp.56 75. 18. Richard L. White, rlw@stsci.edu, 1996 Aug 16, http://sundog.stsci.edu /rick/SCMA/node2.html

63

You might also like