Next Article in Journal
Automated Detection of Multiple Lesions on Chest X-ray Images: Classification Using a Neural Network Technique with Association-Specific Contexts
Previous Article in Journal
Recent Developments of Solar Cells from PbS Colloidal Quantum Dots
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Software Defect Prediction Using Heterogeneous Ensemble Classification Based on Segmented Patterns

1
King Abdullah II School for Information Technology, The University of Jordan, Amman 11942, Jordan
2
Department of Computer Science, Faculty of Information Technology, Zarqa University, Zarq 13132, Jordan
3
College of Humanities and Sciences, University of Science and Technology of Fujairah, Fujairah 2202, UAE
*
Author to whom correspondence should be addressed.
Appl. Sci. 2020, 10(5), 1745; https://doi.org/10.3390/app10051745
Submission received: 28 October 2019 / Revised: 20 February 2020 / Accepted: 25 February 2020 / Published: 3 March 2020
(This article belongs to the Section Computing and Artificial Intelligence)

Abstract

:
Software defect prediction is a promising approach aiming to improve software quality and testing efficiency by providing timely identification of defect-prone software modules before the actual testing process begins. These prediction results help software developers to effectively allocate their limited resources to the modules that are more prone to defects. In this paper, a hybrid heterogeneous ensemble approach is proposed for the purpose of software defect prediction. Heterogeneous ensembles consist of set of classifiers of different learning base methods in which each of them has its own strengths and weaknesses. The main idea of the proposed approach is to develop expert and robust heterogeneous classification models. Two versions of the proposed approach are developed and experimented. The first is based on simple classifiers, and the second is based on ensemble ones. For evaluation, 21 publicly available benchmark datasets are selected to conduct the experiments and benchmark the proposed approach. The evaluation results show the superiority of the ensemble version over other well-regarded basic and ensemble classifiers.

1. Introduction

Individuals and society increasingly rely on advanced software systems. Because software is intertwined with all aspects of our lives, it is essential to produce reliable and trustworthy systems economically and quickly. In order to ensure the desired software quality at a lower cost, much effort has been invested on software reliability and software quality assurance (SQA) [1,2]. With limited resources, however, this is increasingly being challenged by the rapid growth in size and complexity of today’s software. Defective software modules increase the development and maintenance costs and cause customer dissatisfaction [3,4].
Software defect prediction is one of the SQA activities that aims to automatically predict fault-prone software modules using historical software information from an earlier deployment or identical objects, for example source code edit logs [5] and bug reports [6], before the actual testing process begins. Effective defect prediction could help test managers locate bugs and facilitate the allocation of limited SQA resources optimally and economically; thus, it has become an extremely important research topic [7,8,9,10,11,12]. Commonly, a prediction model is used to predict the defective software modules in one of the three categories: binary class classification of defects [13,14,15,16], number of defects/defect density prediction [17,18,19,20], and severity of defect prediction [21,22].
Among them, the binary class classification is the most frequently used types of prediction scheme, where software modules having one or more defects are marked as defected and modules having zero defects are marked as non-defected. In this type of defect prediction schema, researchers have explored the use of various classification techniques, including statistical techniques such as Naïve Bayes (NB) [23] and Logistic Regression [24]; supervised techniques such as Decision Tree (DT) [25], Support Vector Machine (SVM) [26], ensemble methods [16,27,28,29], and Case Based Reasoning [30]; semi supervised techniques such as Expectation Maximization (EM) [31]; and unsupervised techniques such as K-means clustering [32] and Fuzzy clustering [33]. Most of the studies in the literature have used statistical and supervised learning techniques [34].
Although a large number of studies have been conducted to build and evaluate defect prediction models using different classification techniques in the context of binary class classification, still the prediction accuracy of defect prediction techniques is found to be considerably low, with a high misclassification rate [26,34,35,36]. Looking at these results, one questions the dependability of these techniques for software defect prediction [34,37]. Therefore, it will be important to design more advanced techniques to improve the performance of defect prediction models [34,38].
In this work, a hybrid heterogeneous ensemble approach is proposed for improving the accuracy of software defect prediction. The core argument for this approach is to develop expert and robust classification models of different natures based on groups of similar points. In other words, the classification models are of different machine learning types like lazy classifiers, decision trees, naïve bayes, and ensembles. While on the other hand, similar points refer to a group of points that are as close as possible according to a similarity measure like the euclidean measure. These groups of data are generated using a clustering stage. Unlike most of the previous works that generate general models for all data, this work aims to develop several expert models based on the characteristics of the data. Two versions of the proposed approach are developed and experimented. The first is based on simple classifiers (i.e., k-Nearest Neighbour (k-NN), NB, and DT), and the second is based on ensemble ones (i.e., Bagging, Adaptive Boosting (AdaBoost), Random Forest (RF), and XGBoost (XGB)). Extensive experiments based on 21 well-known benchmark datasets are conducted to evaluate the proposed approach.
The remainder of this article is organized as follows: The next section presents related work on defect prediction. The preliminaries of the algorithms utilized in the proposed approach are given in Section 3. Section 4 presents the proposed hybrid heterogeneous ensemble approach for software defect prediction. Section 5 discusses the model evaluation metrics, and Section 6 presents the benchmark datasets specifications. Section 7 is devoted to the benchmarking experiments and discusses their respective results. Finally, Section 8 draws conclusions and describes promising directions for future work.

2. Related Work

During the last two decades, software defect prediction problem became a noteworthy research topic, increasingly catching the interest of researchers. A software defect prediction model can be used to classify software modules into defected or non-defected (binary class classification), to predict the number of defects in a software module, or to predict the severity of the defects. In the context of binary class classification, hundreds of different defect prediction models have been published. To build these models, researchers have used various classification techniques to build the defect prediction models such as Logistic Regression [24], NB [23], SVM [26], ANN [39], Genetic Programming [40], Ant Colony Optimization [14], Particle Swarm Optimization [41], RF [42], Case Based Reasoning [30], DT [25], ensemble methods [16,28,29,43,44], EM [31], Fuzzy clustering [33], K-means clustering [32], Association Rule Mining [45], and the Artificial Immune Systems [46,47].
In these techniques, researchers have applied several statistical and machine learning techniques to predict fault proneness models and reduce software development and maintenance costs. Among them, the machine learning technique is the most popular [1]. The majority of software defect prediction techniques build models using metrics and faulty data from an earlier deployment or identical objects and then use the models to predict whether the modules presently under development contain defects, which is called a supervised learning approach [7]. Among the supervised learning techniques, ANN is one of the most popular, having received a great deal of attention) [39,48,49]. It should be pointed out that the ANN technique has some drawbacks in application for software defect prediction, the most important being the difficulty in determining the best neural network architecture in each application domain [49]. In contrast, there are other approaches, for example, clustering [33], which do not use previous data; these approaches are called unsupervised learning approaches. It is worth pointing out that some researchers, for example [50], classify software defect prediction techniques into descriptive and predictive techniques.
The usage of machine learning algorithms has increased in the last decade and is still one of the most popular methods for defect prediction [51,52]. Challagulla et al. [53] conducted an empirical assessment to evaluate the performance of various machine learning techniques and statistical models for predicting software quality. The experiments on four different real-time software defect datasets using different predictor models revealed that the 1R rule-based classification learning algorithm and Instance-based learning along with Consistency-based subset evaluation technique is more consistent in achieving accurate predictions as compared with other models. Based on their results, the authors presented a high-level design of an intelligent software defect analysis tool for defect assessment and dynamic monitoring of software modules. Catal and Diri [54] investigated the effects of data size, metrics, and feature selection techniques on software defect prediction. Nine classifiers were examined to explore which classifier performs best before and after applying feature reduction. They showed that NB is the best prediction algorithm for small datasets while Random Forests gives the best prediction performance for large datasets. Kaur and Pallavi [55] discussed the utilization of numerous machine learning approaches—for example, association mining, classification, and clustering in software defect prediction—but did not provide a comparative performance analysis of the techniques. Kumar and Gopal [56] proposed a binary classifier referred as LSTSVM which is the Least Square variant of Twin Support Vector Machine. The experiments showed that LSTSVM has comparable classification accuracy to Twin Support Vector Machine (TSVM) but with considerably lesser computational time. Agrawal and Tumar [57] proposed a feature selection based on the LSTSVM model for software defect prediction. A comparative analysis of various classification approaches against four PROMISE datasets showed the superiority of the proposed predictive model over other models, i.e., SVM and DT, in three datasets. Again, Tumar and Agrawal [58] developed a software defect prediction system using a weighted LSTSVM to consider misclassification cost of defective software modules. A comparison has been performed between the proposed approach and nine of the existing approaches using different performance measures. The results on eight datasets demonstrated the effectiveness of the proposed approach. Shukla and Verma [59] reviewed and analysed various literature studies on defect prediction area, investigated recent advancement in this area, and drew various conclusions. Dwivedi and Singh [60] analysed and compared various data mining classification and prediction techniques such as NN, NB, and k-NN for the software defect prediction models. The results showed that NN can outperform other two classifiers with the average accuracy of 91.54%. Wang et al. [8] proposed to leverage the directly learned semantic features to build machine learning models for predicting defects. The results on ten open source projects showed that the automatically learned semantic features using Deep Belief Network (DBN) improved within-project defect prediction on average by 14.7% in precision, 11.5% in recall, and 14.2% in F1. To reduce the complexity of metric selection and defect prediction, Huda et al. [61] proposed a framework for finding significant metrics to build and evaluate an automated software defect prediction model, using a hybrid combination of wrapper and filter techniques. Experimental results with eight NASA software datasets showed that the proposed hybrid approaches can select the most significant metrics with high prediction accuracy compared with conventional wrapper or filter approaches in some of the datasets. The highest accuracy achieved by the hybrid approach was almost 91% at different subset of metrics. Recently, Bowes et al. [62] performed a sensitivity analysis for the prediction uncertainty produced by four different classifiers. Their results showed that classifier ensembles with decision-making strategies that are not based on majority voting are likely to perform best. Zhou et al. [38] proposed a new deep forest model to build the defect prediction model (DPDF). Their results on 25 open source projects from four public datasets showed that the DPDF increased AUC value by 5% compared best traditional machine learning algorithms.

3. Preliminaries

In this section, we briefly describe each of the algorithms utilized in the proposed approach.

3.1. NB

NB is a statistical probability-based classifier based on the Bayes theorem. NB is a family of algorithms based on a common principle, which assumes that all of the predictors are equally important and independent of each other [63]. In other words, when the class variable is given, it assumes the presence or absence of a particular feature is not related to the presence or absence of any other feature [64]. Instead of simple classification, NB reports the probability of an instance belonging to each individual class. In our case, the class with the highest posterior probability is the outcome of prediction that predicts whether a software module is defective or non-defective.

3.2. k-NN

k-NN is an instance-based learning method that classifies instances within a dataset by assigning the label of the closest neighbour to each new pattern during the testing phases. If the instances are tagged with a classification label, then the majority class of the closest k neighbours is assigned to the unclassified instance. Although the power of k-NN has been proven in a number of real domains, they have large storage requirements and their performance is sensitive to the choice of the k.

3.3. DT

DT is a logic-based learning method that classifies instances by sorting them based on feature values. The main idea underlying DT for classification tasks is the recursive partition of the data space; thus, a DT can be equivalently expressed as a set of rules. DT utilizes a tree-like data structure where each node in the tree represents a feature in an instance to be classified, whereas each branch represents a value that the node can assume [65]. The classification of instances starts at the root node, and instances are sorted based on their feature values. The most well-known algorithm in the literature for building tree is the C4.5, which is an extension of the ID3 algorithm. Although DT can effectively deal with nonlinear relationships, it is sensitive to noisy data and also may lead to overfitting.

3.4. Adaboost

AdaBoost is a widely used boosting algorithm that constructs an ensemble by performing multiple iterations each time with different instance weights and adjusts adaptively to the errors returned by classifiers from previous iterations [66,67]. Changing the weights of training instances in each iteration forces the learning algorithms to put more emphasis on instances that were incorrectly classified previously and less emphasis on instances that were correctly classified previously. In other words, weights of misclassified instances are increased, whereas weights of correctly classified instances are decreased. This will ensure misclassification errors for these misclassified instances count more heavily in the next iterations. AdaBoost uses the predictions of multiple weak classifiers and gives a final prediction through combined voting on techniques. Weak classifiers as originally defined by Freund and Schapire are classifiers that perform a little better than random guessing [68].

3.5. Bagging

Bagging is an ensemble technique that is used to improve the stability and accuracy of machine learning algorithms by combining the prediction of multiple weak classifiers [69]. Bagging works better for unstable learning algorithms where a little change in the training set results in large changes in predictions (i.e., ANN, DT). Bagging predicts an outcome several times from different training sets that are combined either by voting or with uniform averaging [70]. To describe the bagging algorithm, consider a dataset with N instances and a binary class label. The following steps summarize the Bagging algorithm:
1.
Generate a random training set of size N with replacement from the data.
2.
Train the random training set using any classification technique.
3.
Assign a class to each node.
4.
Repeat steps 1 to 3 many times.
5.
Use voting to predict the class label.

3.6. RF

The RF classifier is a special case of Bagging consisting of a collection of tree-structured classifiers. RF selects random features in order to create bootstrap models using decision trees [71]. To do so, it creates a random forest of multiple decision trees by selecting data and variables randomly. A subset of instances is chosen randomly from the selected attributes and assigned to the learning algorithm. The forest selects the classification that has the most votes over all the trees in the forest. RF relies on aggregating the output from many “shallow” trees (called stumps), which are tuned and pruned without much analysis, so that the errors from many stumps will disappear when aggregated and lead to a more accurate prediction. Randomization in RF appears in two places:
1.
Each tree is trained using a random sample with replacement from a training set.
2.
When training individual trees, a random subset of features is used for searching for splits. The randomization reduces the correlations among trees, which improves the predictive performance.

3.7. XGB

XGB is a decision-tree-based supervised learning algorithm that implements a process called Gradient Boosting to construct an ensemble learner [72]. XGB optimises a collection of weak decision tree learning models to build an accurate and reliable predictor, decision tree ensemble, which uses the output of the weak learners in the final prediction. XGB improves upon the base Gradient Boosting Machines (GBMs) framework through algorithmic enhancements (i.e., Regularization, Sparsity Awareness, Weighted Quantile Sketch) and software and hardware optimization techniques (i.e., Parallelization, Tree Pruning). These improvements yield superior results using less computing resources in the shortest amount of time.

3.8. K-Means Clustering

K-means clustering is one of the most popular unsupervised learning methods. The main goal of K-means is to group similar data instances together and find patterns in the given datasets. To achieve this goal, K-means defines number of clusters (K) and then groups the similar elements into these clusters. It starts by selecting the centriods, which are the starting points of the clusters. In the next step it assigns the instances to the closest centroid and then updates the positions of the centroids iteratively until the centroids are stabilized or the predefined maximum number of iterations is reached.
Given a dataset of n instances S = { x 1 , , x n } R d , and an integer number K, K-means algorithm aims to find C = { c 1 , , c K } , the set of centroids with respect to the following error function:
E ( C ) = x S m i n i = 1 , . . . , K x - c i 2
As mentioned before, K-means assigns instances to one of the specified clusters according to the similarity between them. To measure the similarity, it usually uses the Euclidean distance between the instance and the centroids.

4. Proposed Approach

In this paper, we propose an approach for software defect classification where models are developed based on clustered patterns. The approach is composed of three main phases: In the first phase, a clustering process is applied on the training data to segment it into a set of groups of similar instances. In the second phase, different classifiers are trained based on the generated groups from the first phase. The third phase evaluates the developed models and uses them for predicting unrepresented instances. These three phases are illustrated in Figure 1 and described in details in the following three subsections.

4.1. Clustering Phase

The clustering phase is the first phase of the hybrid algorithm. The idea is to start a preprocessing step to prepare the data for developing the classification algorithms. The data is split into two parts: the training part, which is the only part that is used in this stage for clustering, and a testing part, which is used to evaluate the performance of the trained models. During this preprocessing step, we start by clustering training data into a set of predefined number of clusters. We can use any clustering technique, but in our work one of the most popular clustering techniques, the k-means algorithm, will be used.

4.2. Models Development Phase

After segmenting the training data into a set of clusters, the next step is to develop a classification model for each cluster. To do that, several classification algorithms are trained and evaluated on each cluster using the cross-validation methodology. The goal is to find the most suitable and expert model for each cluster. For example, suppose we have three classification algorithms called X, Y, and Z. All algorithms will be trained and evaluated based on each cluster. For example, if algorithm Y produced the highest average accuracy over the cross-validation process based on a given cluster, then Y will be assigned to this cluster for future predictions because it showed higher prediction power than algorithms X and Z. It is important to note that when there is a cluster of only one class the classifier works as one class classification algorithm. So, it trains based on one class in the training phase and detects the other class in the testing phase as outlier. After finishing this phase, each cluster will have its own expert model. Note that the best classifier can be different from one cluster to another. Figure 2 gives an example of this phase with three different classifiers trained on three clusters, and it shows how the classifiers in the final model are selected.
In this work, two types of classifiers are implemented to produce two versions of the proposed approach. In the first version, basic classifiers are used. This version will be referred to as K-Means/Basic classifiers (KMB). In the second version, ensemble classifiers will be utilized. The latter version will be referred to as K-Means/Ensemble classifiers (KME).

4.3. Testing Phase

In the testing phase, we are concerned with the testing data generated in the first phase. For each instance in the testing data, we must specify to which cluster it belongs by calculating the distance between the instance and each centroid of the clusters. As a result, the instance will belong to the closest cluster (most similar), and it will be given to the model that has been assigned to the cluster in the training phase for final prediction. To determine the similarity, we use the Euclidean distance between the testing instance I and the centroid C, which can be defined as follows:
d ( I , C ) = i = 1 d ( I i - C i ) 2
where d is the number of input features in the dataset.
After classifying all instances in the testing data, we can use the predictions against the actual values of classes to evaluate the performance of the given hybrid algorithm. The procedure of the algorithm is explained in Algorithm 1.
Algorithm 1: Ensemble with clustering.
Applsci 10 01745 i001

5. Model Evaluation Metrics

To evaluate the proposed software defect prediction model, we refer to the confusion matrix shown in Table 1, which is the primary source for accuracy estimation in classification problems. Based on this confusion matrix, the following criteria are used for evaluation:
1.
Recall: is the fraction of relevant instances that have been retrieved over the total amount of relevant instances (i.e., coverage rate). It can be expressed by the following equation:
R e c a l l = T P T P + F N
2.
Precision: is the ratio of relevant instances among the retrieved instances. It can be given by the following equation:
P r e c i s i o n = T P T P + F P
3.
G-mean: is the geometric mean of the recalls of each class and it can be measured by the following equation:
G - m e a n = T P T P + F N × T N T N + F P

6. Datasets Description

To facilitate the replication and verification of our experiments, the proposed approach is applied to a series of 21 well-studied public and available online software defect benchmark datasets with various attributes and instances. Eleven of the studied datasets are obtained from the NASA corpus while ten from the PROMISE software engineering corpus [73]. However, the NASA corpus is a known-to-be noisy corpus [74,75]. To avoid the effect of such noisy data on the results of our experiments, we use the cleaned version of the NASA corpus as provided by [74], which is available online (https://figshare.com/articles/MDP_data_sets_D_and_D_-_zipped_up/6071675). The NASA datasets were collected from real software projects from different domains by NASA and have various software modules developed in several different programming languages including, C, C++, and Java, various scales of lines of code, and various types of software metrics. For instance, in the cleaned version of the NASA corpus, the JM1 dataset consists of 7782 instances (1672 defective/6110 defect-free) where each instance includes a total of 22 attributes, of which five are different lines of code measures, three are McCabe metrics, four are base Halstead measures, eight are derived Halstead measures, one is a branch-count, and one is a decision attribute that indicates whether a particular instance is defective or non-defective. The PROMISE datasets were collected from open source software projects developed in a variety of settings (e.g., Apache, GNU) which provides different metrics than the NASA corpus does. Table 2 shows information and some general statistics of each dataset.

7. Experiments and Results

The experiments was executed 30 independent time then the average of the results was calculated. The experiments will be conducted in three steps:
  • The best number of clusters is experimented for each dataset, and the best model for each cluster is found.
  • The proposed approach is experimented based on utilizing simple and common classifiers (NB, k-NN, and DT).
  • The proposed approach is experimented based on utilizing powerful ensemble classifiers (Bagging, AdaBoost, RF, and XGB).
For k-NN, the number of neighbours is set to 3 as this value showed best performance based on the training data compared to other values (i.e., 1, 5, 7, and 9). For the ensemble classifiers, the selected base classifier is decision tree, and the ensemble size is set to 100. The latter settings yield the best performance based on the training data with the least computation effort.

7.1. Finding the Best Number of Clusters and Their Corresponding Models

The number of clusters in our final model will be determined based on the G-mean results of the training phase. Cross-validation approaches can help avoid overfitting in model selection [76]. Therefore, the training process is conducted based on two-folds cross-validation to avoid overfitting. Four settings are experimented to determine the required number of clusters: 3, 5, 7 or 9. The number of clusters that yield the highest G-mean value will be selected to be applied for the final model in the testing phase. Table 3 and Table 4 show the G-mean results of the cross-validation training phase of our approach based on the basic classifiers and ensemble ones, respectively. As it can be seen in the tables, the best number of clusters varies from one dataset to another. This confirms that the software defect benchmark datasets are varied in their nature, where different groups can be identified, and these groups have a number of similar patterns. Table 3 and Table 4 also show the distribution of classes in each cluster. It is important to note here that sometimes the clustering process produce clusters that contain only class. For such cases, any new instance that is closer to the center of a one-class cluster will be simply given the same class of the cluster.
For each cluster that results from the previous step, the best performing classifier is assigned. Demonstrating the best performing models for KMB and KME, Figure 3 and Figure 4 show the frequency of the best models over all datasets. In the case of KMB, we can see that the DT is the most frequent classifier in most of cases, followed by NB and k-NN. In the case of KME, Bagging is the most frequent model, followed by XGB, RF and AdaBoost, respectively. This supports the idea that there is no dominating classifier for all the data patterns, and each group of similar patterns needs a model that fits its particular characteristics.

7.2. KMB vs. Basic Classifiers

In this part of the experiments we verify the performance of the KMB version of our proposed approach by experimenting it based on the 21 benchmark datasets and comparing it with the basic classifiers NB, k-NN, and DT.
Because all of the datasets are highly imbalanced, considering the accuracy ratio for evaluation is misleading. Therefore, other metrics (i.e., recall, precision, and G-mean) should be examined. The results of precision, recall and G-mean values are shown in Table 5. According to the results, we can see that KMB hits the best or very competitive precision and recall values for most of the datasets. The results of the G-mean evaluation measure reveal that KMB has better performance in 21 datasets, followed by NB and k-NN respectively, where NB achieved best results only in two datasets, and k-NN in one dataset.
For better visualization of the results, radar Figure 5, Figure 6 and Figure 7 are plotted for KMB and the basic classifiers.

7.3. KME vs. Ensemble Classifiers

Here we experiment the KME version of the proposed algorithm, which combines ensemble classifiers instead of simple classifiers in an attempt to boost the predictive power of the approach. For precision and recall, Table 6 shows that KME is dominating the top rates especially in regard to precision. Considering the G-mean results in Table 6, we can see that KME hits the best results in 19 datasets out of 21. For better visualization of the obtained results, radar Figure 8, Figure 9 and Figure 10 are plotted for KME and the ensemble classifiers. By comparing the performance of KMB and KME in terms of G-mean results, Table 7 shows that the KMB achieves better results in 14 datasets out of 21 indicating that it is not necessary to apply the KME in all cases. This could be explained by the fact that KMB is a type of ensemble classification and it combines weak classifiers which could prevent overfitting. This is unlike the case of KME which combines powerful classifiers.
The boxplots for KMB and KME represented in Figure 11 and Figure 12. These boxplots are created for reporting the G-mean of 30 independent runs for all datasets. The figures show that KMB and KME are very competitive and stable in most of the datasets. It can be noted that for few datasets KMB and KME exhibit more sensitive performance than the other datasets. Examples of these datasets are cm1, mc1, mw1 and pc2. This sensitivity can be due to the high imbalance ratio in these datasets, that is, misclassifying one instant from the rare class will highly impact the G-mean measure. For jedit-4.3 dataset, the single classifier approach failed to classify the rare instances therefore its recall is 0 and consequently the G-mean is 0. On the other hand, for the log4j-1.2 dataset, performance of of KMB and KME was worse than the other classifiers which could be reasoned to the clustering step which produced clusters that are harder for KMB and KME to cluster.
Although the purposed approaches have been compared with the best traditional machine learning algorithms, we also compare the proposed KME with the results of one of the most recent sophisticated approaches called defect prediction based on deep forest (DPDF) [38]. Specifically, we used the common datasets used in their published results and in our approach, 13 datasets, to compare our approach against in terms of precision and recall as shown in Table 8. The results show that KME outperforms the DPDF in all datasets except for pc2 and tomcat-6.0.

7.4. Statistical Test

A nonparametric statistical test—The Friedman test—of multiple group measures is usually used to approve the null hypothesis that the multiple group measures have the same variance using a precise level of significance. Alternatively, rejecting the null hypothesis approves that they have different variance values. We analyze the execution of the Algorithms using the Friedman test in SPSS and we run the test 21 times using different datasets. For each experiment we used H0 that there is no difference in the execution between the Algorithms and H1 that there is a difference in the execution of the Algorithms. We reject H0 for p < α : as α = 0 . 05 is used as the significance level in this hypothesis testing. The results of Friedman test are shown in Table 9. From the results, we can see that the Mean ranks differ quite a lot in favor of the KME Algorithm and for the KMB Algorithm in almost all the experiments. The Chi-Square test statistics mainly summarize how differently our Algorithms were rated in a single number. The degrees of freedom in our experiments, 9 (Algorithms) variables − 1 = 8 degrees of freedom. The results show that there is a significant difference the execution of the Algorithms for all the experiments Since the p-value (Asymp. Sig.) < 0.05, and we cannot accept the null hypothesis of equal population distributions. Moreover, the whole table illustrates which Algorithm was ranked best versus worst. In other words, the Friedman test points out that our Algorithms were rated differently, Chi-Square values with a p-value ≤ 0.0000 for all experiments.

8. Conclusions

In this paper, a hybrid classification approach for software defect prediction was proposed. The main idea of this approach was to develop expert and robust classification models based on groups of similar patterns. Two versions were developed and experimented on. The first was based on simple classifiers, whereas the second was based on ensemble ones. After extensive experiments based on 21 well-known benchmark datasets, the evaluation results showed that the ensemble version of the proposed approach can significantly boost the prediction power compared to the other ensemble and basic classifiers in most of the datasets. The reason for this superior performance is that the proposed approach develops models that fit specific patterns that have similar behaviours.
For future work, two areas could be researched for improvement. The first is to explore more advanced clustering algorithms, and the second is to investigate techniques that can automatically determine the best number of clusters for each dataset.

Author Contributions

Conceptualization, H.A. and H.F.; Methodology, H.A. and H.F.; Software, M.E. and N.H.; Validation, N.H., M.E. and I.A.; Formal analysis Y.A. and A.A.R.; Investigation, H.A. and N.H.; Resources, I.A. and A.A.R.; Data curation, H.A. and N.H.; Writing—original draft preparation, H.F. and H.A.; Writing—review and editing, I.A., H.A., Y.A. and H.F.; Supervision H.A. and H.F.; Project administration, H.F. and H.A. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Rawat, M.S.; Dubey, S.K. Software defect prediction models for quality improvement: A literature study. IJCSI Int. J. Comput. Sci. Issues 2012, 9, 288–296. [Google Scholar]
  2. Aljarah, I.; Banitaan, S.; Abufardeh, S.; Jin, W.; Salem, S. Selecting discriminating terms for bug assignment: A formal analysis. In Proceedings of the 7th International Conference on Predictive Models in Software Engineering, Banff, AB, Canada, 20–21 September 2011; p. 12. [Google Scholar]
  3. Fenton, N.E.; Neil, M. Software metrics: Roadmap. In Proceedings of the Conference on the Future of Software Engineering, Limerick, Ireland, 4–11 June 2000; pp. 357–370. [Google Scholar]
  4. Fenton, N.; Bieman, J. Software Metrics: A Rigorous and Practical Approach; CRC Press: Boca Raton, FL, USA, 2014. [Google Scholar]
  5. Moser, R.; Pedrycz, W.; Succi, G. A comparative analysis of the efficiency of change metrics and static code attributes for defect prediction. In Proceedings of the 2008 ACM/IEEE 30th International Conference on Software Engineering, Leipzig, Germany, 10–18 May 2008; pp. 181–190. [Google Scholar]
  6. Bhattacharya, P.; Iliofotou, M.; Neamtiu, I.; Faloutsos, M. Graph-based analysis and prediction for software evolution. In Proceedings of the 2012 34th International Conference on Software Engineering (ICSE), Zurich, Switzerland, 2–9 June 2012; pp. 419–429. [Google Scholar]
  7. Abaei, G.; Selamat, A. A survey on software fault detection based on different prediction approaches. Vietnam J. Comput. Sci. 2014, 1, 79–95. [Google Scholar] [CrossRef]
  8. Wang, S.; Liu, T.; Tan, L. Automatically learning semantic features for defect prediction. In Proceedings of the 38th International Conference on Software Engineering, Austin, TX, USA, 14–22 May 2016; pp. 297–308. [Google Scholar]
  9. Clark, B.; Zubrow, D. How Good Is the Software: A Review of Defect Prediction Techniques; Sponsored by the US Department of Defense; InSoftware Engineering Symposium, Carreige Mellon University: Pittsburgh, PA, USA, 2001. [Google Scholar]
  10. Hall, T.; Beecham, S.; Bowes, D.; Gray, D.; Counsell, S. A systematic literature review on fault prediction performance in software engineering. IEEE Trans. Softw. Eng. 2012, 38, 1276–1304. [Google Scholar] [CrossRef]
  11. Malhotra, R. A systematic review of machine learning techniques for software fault prediction. Appl. Soft Comput. 2015, 27, 504–518. [Google Scholar] [CrossRef]
  12. Menzies, T.; Milton, Z.; Turhan, B.; Cukic, B.; Jiang, Y.; Bener, A. Defect prediction from static code features: Current results, limitations, new approaches. Autom. Softw. Eng. 2010, 17, 375–407. [Google Scholar] [CrossRef]
  13. Li, Z.; Reformat, M. A practical method for the software fault-prediction. In Proceedings of the 2007 IEEE International Conference on Information Reuse and Integration, Las Vegas, IL, USA, 13–15 August 2007; pp. 659–666. [Google Scholar]
  14. Vandecruys, O.; Martens, D.; Baesens, B.; Mues, C.; De Backer, M.; Haesen, R. Mining software repositories for comprehensible software fault prediction models. J. Syst. Softw. 2008, 81, 823–839. [Google Scholar] [CrossRef]
  15. Mendes-Moreira, J.; Soares, C.; Jorge, A.M.; Sousa, J.F.D. Ensemble approaches for regression: A survey. ACM Comput. Surv. (CSUR) 2012, 45, 10. [Google Scholar] [CrossRef]
  16. Alsawalqah, H.; Faris, H.; Aljarah, I.; Alnemer, L.; Alhindawi, N. Hybrid SMOTE-Ensemble Approach for Software Defect Prediction. In Proceedings of the Computer Science On-Line Conference, Prague, Czech Republic, 26–29 April 2017; Springer: Cham, Switzerland, 2017; pp. 355–366. [Google Scholar]
  17. Rathore, S.S.; Kuamr, S. Comparative analysis of neural network and genetic programming for number of software faults prediction. In Proceedings of the 2015 National Conference on Recent Advances in Electronics & Computer Engineering (RAECE), Roorkee, India, 13–15 February 2015; pp. 328–332. [Google Scholar]
  18. Rathore, S.S.; Kumar, S. Predicting number of faults in software system using genetic programming. Procedia Comput. Sci. 2015, 62, 303–311. [Google Scholar] [CrossRef] [Green Version]
  19. Rathore, S.S.; Kumar, S. An empirical study of some software fault prediction techniques for the number of faults prediction. Soft Comput. 2016, 21, 7417–7434. [Google Scholar] [CrossRef]
  20. Rathore, S.S.; Kumar, S. Linear and non-linear heterogeneous ensemble methods to predict the number of faults in software systems. Knowl.-Based Syst. 2017, 119, 232–256. [Google Scholar] [CrossRef]
  21. Shatnawi, R.; Li, W. The effectiveness of software metrics in identifying error-prone classes in post-release software evolution process. J. Syst. Softw. 2008, 81, 1868–1882. [Google Scholar] [CrossRef]
  22. Sandhu, P.S.; Singh, S.; Budhija, N. Prediction of level of severity of faults in software systems using density based clustering. In Proceedings of the 2011 IEEE International Conference on Software and Computer Applications. IPCSIT, Kathmandu, Nepal, 1–2 July 2011. [Google Scholar]
  23. Menzies, T.; Greenwald, J.; Frank, A. Data mining static code attributes to learn defect predictors. IEEE Trans. Softw. Eng. 2007, 33, 2–13. [Google Scholar] [CrossRef]
  24. Suffian, M.D.M.; Ibrahim, S. A Prediction Model for System Testing Defects using Regression Analysis. arXiv 2014, arXiv:1401.5830. [Google Scholar]
  25. Koprinska, I.; Poon, J.; Clark, J.; Chan, J. Learning to classify e-mail. Inf. Sci. 2007, 177, 2167–2187. [Google Scholar] [CrossRef]
  26. Elish, K.O.; Elish, M.O. Predicting defect-prone software modules using support vector machines. J. Syst. Softw. 2008, 81, 649–660. [Google Scholar] [CrossRef]
  27. Huda, S.; Liu, K.; Abdelrazek, M.; Ibrahim, A.; Alyahya, S.; Al-Dossari, H.; Ahmad, S. An ensemble oversampling model for class imbalance problem in software defect prediction. IEEE Access 2018, 6, 24184–24195. [Google Scholar] [CrossRef]
  28. Jiang, Y.; Cukic, B.; Ma, Y. Techniques for evaluating fault prediction models. Empir. Softw. Eng. 2008, 13, 561–595. [Google Scholar] [CrossRef]
  29. Sun, Z.; Song, Q.; Zhu, X. Using coding-based ensemble learning to improve software defect prediction. IEEE Trans. Syst. Man Cybern. Part C (Appl. Rev.) 2012, 42, 1806–1817. [Google Scholar] [CrossRef]
  30. El Emam, K.; Benlarbi, S.; Goel, N.; Rai, S.N. Comparing case-based reasoning classifiers for predicting high risk software components. J. Syst. Softw. 2001, 55, 301–320. [Google Scholar] [CrossRef]
  31. Seliya, N.; Khoshgoftaar, T.M. Software quality estimation with limited fault data: A semi-supervised learning perspective. Softw. Qual. J. 2007, 15, 327–344. [Google Scholar] [CrossRef]
  32. Catal, C.; Sevim, U.; Diri, B. Software fault prediction of unlabeled program modules. In Proceedings of the World Congress on Engineering, London, UK, 1–3 July 2009; Volume 1, pp. 1–3. [Google Scholar]
  33. Yuan, X.; Khoshgoftaar, T.M.; Allen, E.B.; Ganesan, K. An application of fuzzy clustering to software quality prediction. In Proceedings of the 3rd IEEE Symposium on Application-Specific Systems and Software Engineering Technology, Richardson, TX, USA, 24–25 March 2000; pp. 85–90. [Google Scholar]
  34. Rathore, S.S.; Kumar, S. A study on software fault prediction techniques. Artif. Intell. Rev. 2019, 51, 255–327. [Google Scholar] [CrossRef]
  35. Challagulla, V.U.; Bastani, F.B.; Yen, I.L. A unified framework for defect data analysis using the mbr technique. In Proceedings of the 2006 18th IEEE International Conference on Tools with Artificial Intelligence (ICTAI’06), Arlington, VA, USA, 13–15 November 2006; pp. 39–46. [Google Scholar]
  36. Guo, L.; Cukic, B.; Singh, H. Predicting fault prone modules by the dempster-shafer belief networks. In Proceedings of the 18th IEEE International Conference on Automated Software Engineering, Montreal, QC, Canada, 6–10 October 2003; pp. 249–252. [Google Scholar]
  37. Catal, C. Software fault prediction: A literature review and current trends. Expert Syst. Appl. 2011, 38, 4626–4636. [Google Scholar] [CrossRef]
  38. Zhou, T.; Sun, X.; Xia, X.; Li, B.; Chen, X. Improving defect prediction with deep forest. Inf. Softw. Technol. 2019, 114, 204–216. [Google Scholar] [CrossRef]
  39. Quah, T.S.; Thwin, M.M. Application of neural networks for software quality prediction using object-oriented metrics. In Proceedings of the International Conference on Software Maintenance (ICSM 2003), Amsterdam, The Netherlands, 22–26 September 2003; pp. 116–125. [Google Scholar]
  40. Evett, M.; Khoshgoftar, T.; Chien, P.D.; Allen, E. GP-based software quality prediction. In Proceedings of the Third Annual Conference Genetic Programming, Madison, WI, USA, 22–25 July 1998; pp. 60–65. [Google Scholar]
  41. De Carvalho, A.B.; Pozo, A.; Vergilio, S.R. A symbolic fault-prediction model based on multiobjective particle swarm optimization. J. Syst. Softw. 2010, 83, 868–882. [Google Scholar] [CrossRef]
  42. Koru, A.G.; Liu, H. Building effective defect-prediction models in practice. IEEE Softw. 2005, 22, 23–29. [Google Scholar] [CrossRef]
  43. Qiu, S.; Lu, L.; Jiang, S.; Guo, Y. An investigation of imbalanced ensemble learning methods for cross-project defect prediction. Int. J. Pattern Recognit. Artif. Intell. 2019, 33, 1959037. [Google Scholar] [CrossRef]
  44. Peng, Y.; Kou, G.; Wang, G.; Wu, W.; Shi, Y. Ensemble of software defect predictors: An AHP-based evaluation method. Int. J. Inf. Technol. Decis. Mak. 2011, 10, 187–206. [Google Scholar] [CrossRef] [Green Version]
  45. Czibula, G.; Marian, Z.; Czibula, I. Software defect prediction using relational association rule mining. Inf. Sci. 2014, 264, 260–278. [Google Scholar] [CrossRef]
  46. Catal, C.; Diri, B. Software defect prediction using artificial immune recognition system. In Proceedings of the 25th conference on IASTED International Multi-Conference: Software Engineering, Innsbruck, Austria, 13–15 February 2007; pp. 285–290. [Google Scholar]
  47. Catal, C.; Diri, B. A fault prediction model with limited fault data to improve test process. In International Conference on Product Focused Software Process Improvement; Springer: Berlin/Heidelberg, Germany, 2008; pp. 244–257. [Google Scholar]
  48. Kanmani, S.; Uthariaraj, V.R.; Sankaranarayanan, V.; Thambidurai, P. Object-oriented software fault prediction using neural networks. Inf. Softw. Technol. 2007, 49, 483–492. [Google Scholar] [CrossRef]
  49. Begum, M.; Dohi, T. A Neuro-Based Software Fault Prediction with Box-Cox Power Transformation. J. Softw. Eng. Appl. 2017, 10, 288. [Google Scholar] [CrossRef] [Green Version]
  50. Köksal, G.; Batmaz, İ.; Testik, M.C. A review of data mining applications for quality improvement in manufacturing industry. Expert Syst. Appl. 2011, 38, 13448–13467. [Google Scholar] [CrossRef]
  51. Catal, C.; Sevim, U.; Diri, B. Practical development of an Eclipse-based software fault prediction tool using Naive Bayes algorithm. Expert Syst. Appl. 2011, 38, 2347–2353. [Google Scholar] [CrossRef]
  52. Son, L.H.; Pritam, N.; Khari, M.; Kumar, R.; Phuong, P.T.M.; Thong, P.H. Empirical Study of Software Defect Prediction: A Systematic Mapping. Symmetry 2019, 11, 212. [Google Scholar] [CrossRef] [Green Version]
  53. Challagulla, V.B.; Bastani, F.B.; Yen, I.L.; Paul, R.A. Empirical assessment of machine learning based software defect prediction techniques. Int. J. Artif. Intell. Tools 2008, 17, 389–400. [Google Scholar] [CrossRef]
  54. Catal, C.; Diri, B. Investigating the effect of dataset size, metrics sets, and feature selection techniques on software fault prediction problem. Inf. Sci. 2009, 179, 1040–1058. [Google Scholar] [CrossRef]
  55. Kaur, M.J.; Pallavi, M. Data mining techniques for software defect prediction. Int. J. Softw. Web Sci. (IJSWS) 2013, 3, 54–57. [Google Scholar]
  56. Kumar, M.A.; Gopal, M. Least squares twin support vector machines for pattern classification. Expert Syst. Appl. 2009, 36, 7535–7543. [Google Scholar] [CrossRef]
  57. Agarwal, S.; Tomar, D. A feature selection based model for software defect prediction. Assessment 2014, 65. [Google Scholar] [CrossRef]
  58. Tomar, D.; Agarwal, S. Prediction of defective software modules using class imbalance learning. Appl. Comput. Intell. Soft Comput. 2016, 2016, 6. [Google Scholar] [CrossRef] [Green Version]
  59. Shukla, H.; Verma, D.K. A Review on Software Defect Prediction. Int. J. Adv. Res. Comput. Eng. Technol. (IJARCET) 2015, 4, 4387–4394. [Google Scholar]
  60. Kumar Dwivedi, V.; Singh, M.K. Software Defect Prediction using Data Mining Classification Approach. Int. J. Technol. Res. Appl. 2016, 4, 31–35. [Google Scholar]
  61. Huda, S.; Alyahya, S.; Ali, M.M.; Ahmad, S.; Abawajy, J.; Al-Dossari, H.; Yearwood, J. A Framework for Software Defect Prediction and Metric Selection. IEEE Access 2018, 6, 2844–2858. [Google Scholar] [CrossRef]
  62. Bowes, D.; Hall, T.; Petrić, J. Software defect prediction: Do different classifiers find the same defects? Softw. Qual. J. 2018, 26, 525–552. [Google Scholar] [CrossRef] [Green Version]
  63. Turhan, B.; Bener, A.B. Software Defect Prediction: Heuristics for Weighted Naïve Bayes. In Proceedings of the ICSOFT (SE), Barcelona, Spain, 22–25 July 2007; pp. 244–249. [Google Scholar]
  64. Misirli, A.T.; Bener, A.B. A mapping study on bayesian networks for software quality prediction. In Proceedings of the 3rd International Workshop on Realizing Artificial Intelligence Synergies in Software Engineering, Hyderabad, India, 3 June 2014; pp. 7–11. [Google Scholar]
  65. Kotsiantis, S.B.; Zaharakis, I.; Pintelas, P. Supervised machine learning: A review of classification techniques. Emerg. Artif. Intell. Appl. Comput. Eng. 2007, 160, 3–24. [Google Scholar]
  66. Freund, Y.; Schapire, R.E. Experiments with a new boosting algorithm. Inicml 1996, 96, 148–156. [Google Scholar]
  67. Schapire, R.E. Explaining adaboost. In Empirical Inference; Springer: Berlin/Heidelberg, Germany, 2013; pp. 37–52. [Google Scholar]
  68. Freund, Y.; Schapire, R.E. A decision-theoretic generalization of on-line learning and an application to boosting. J. Comput. Syst. Sci. 1997, 55, 119–139. [Google Scholar] [CrossRef] [Green Version]
  69. Breiman, L. Bagging predictors. Mach. Learn. 1996, 24, 123–140. [Google Scholar] [CrossRef] [Green Version]
  70. Wang, T.; Li, W.; Shi, H.; Liu, Z. Software defect prediction based on classifiers ensemble. J. Inf. Comput. Sci. 2011, 8, 4241–4254. [Google Scholar]
  71. Breiman, L. Random forests. Mach. Learn. 2001, 45, 5–32. [Google Scholar] [CrossRef] [Green Version]
  72. Chen, T.; Guestrin, C. Xgboost: A scalable tree boosting system. In Proceedings of the 22nd ACM Sigkdd International Conference on Knowledge Discovery and Data Mining, San Francisco, CA, USA, 13–17 August 2016; pp. 785–794. [Google Scholar]
  73. Menzies, T.; Caglayan, B.; Kocaguneli, E.; Krall, J.; Peters, F.; Turhan, B. The Promise Repository of Empirical Software Engineering Data. Available online: http://promise.site.uottawa.ca/SERepositor (accessed on 1 April 2012).
  74. Shepperd, M.; Song, Q.; Sun, Z.; Mair, C. Data quality: Some comments on the nasa software defect datasets. IEEE Trans. Softw. Eng. 2013, 39, 1208–1215. [Google Scholar] [CrossRef] [Green Version]
  75. Ghotra, B.; McIntosh, S.; Hassan, A.E. Revisiting the impact of classification techniques on the performance of defect prediction models. In Proceedings of the 2015 IEEE/ACM 37th IEEE International Conference on Software Engineering, Florence, Italy, 16–24 May 2015; Volume 1, pp. 789–800. [Google Scholar]
  76. Lever, J.; Krzywinski, M.; Altman, N. Points of significance: Model selection and overfitting. Nat. Methods 2016, 13, 703–704. [Google Scholar] [CrossRef]
Figure 1. Proposed methodology for software defect prediction.
Figure 1. Proposed methodology for software defect prediction.
Applsci 10 01745 g001
Figure 2. Example of the model development phase of the proposed approach.
Figure 2. Example of the model development phase of the proposed approach.
Applsci 10 01745 g002
Figure 3. Frequency of the basic classifiers in K-Means/Basic classifiers (KMB) for different numbers of clusters.
Figure 3. Frequency of the basic classifiers in K-Means/Basic classifiers (KMB) for different numbers of clusters.
Applsci 10 01745 g003
Figure 4. Frequency of the ensemble classifiers in K-Means/Ensemble classifiers (KME) for different numbers of clusters.
Figure 4. Frequency of the ensemble classifiers in K-Means/Ensemble classifiers (KME) for different numbers of clusters.
Applsci 10 01745 g004
Figure 5. Precision for the basic classifiers and KMB.
Figure 5. Precision for the basic classifiers and KMB.
Applsci 10 01745 g005
Figure 6. Recall for the basic classifiers and KMB.
Figure 6. Recall for the basic classifiers and KMB.
Applsci 10 01745 g006
Figure 7. G-mean for the basic classifiers and KMB.
Figure 7. G-mean for the basic classifiers and KMB.
Applsci 10 01745 g007
Figure 8. Precision for the ensemble classifiers and KME.
Figure 8. Precision for the ensemble classifiers and KME.
Applsci 10 01745 g008
Figure 9. Recall for the ensemble classifiers and KME.
Figure 9. Recall for the ensemble classifiers and KME.
Applsci 10 01745 g009
Figure 10. G-mean for the ensemble classifiers and KME.
Figure 10. G-mean for the ensemble classifiers and KME.
Applsci 10 01745 g010
Figure 11. Boxplot representing the G-mean of KMB and KME for NASA datasets.
Figure 11. Boxplot representing the G-mean of KMB and KME for NASA datasets.
Applsci 10 01745 g011
Figure 12. Boxplot representing the G-mean of KMB and KME for PROMISE datasets.
Figure 12. Boxplot representing the G-mean of KMB and KME for PROMISE datasets.
Applsci 10 01745 g012
Table 1. Confusion matrix.
Table 1. Confusion matrix.
Actual
DefectNo Defect
Predicted defectsTPFP
Predicted non-defectsFNTN
Table 2. Datasets specifications.
Table 2. Datasets specifications.
DatasetsAttributesInstancesDefectsNon-DefectsDefects%Non-Defects %
cm1383274228512.887.2
jm12277821672611021.578.5
kc122118331486926.573.5
kc3401943615818.681.4
mc13919884619422.397.7
mw1382532722610.789.3
pc138705616448.791.3
pc237745167292.197.9
pc338107713494312.487.6
pc4381287177111013.886.2
pc5391711471124027.572.5
ant-1.72174516657922.377.7
camel-1.62196518877719.580.5
ivy-2.0213524031211.488.6
jedit-4.321492114812.297.8
log4j-1.2212051891692.27.8
lucene-2.42134020313759.740.3
poi-3.02144228116163.636.4
tomcat-62085877781991
xalan-2.62188541147446.453.6
xerces-1.42158843715174.325.7
Table 3. G-mean results of two-folds cross-validation for the proposed approach based on the basic classifiers.
Table 3. G-mean results of two-folds cross-validation for the proposed approach based on the basic classifiers.
DatasetsKMBBest # of ClustersDistribution of Classes Defects:Non-Defects
1C3C5C7C9C
cm10.5180.6080.7230.7440.84597.7:92.3, 12.8:87.2, 14.3:85.7, 22.2:77.8, 50:50, 0:100, 0:100, 66.7:33.3, 13.8:86.2
jm10.6150.6220.6310.6250.621516.6:83.4, 23.2:76.8, 49.6:50.4, 12.2:87.8, 100:0
kc10.6280.5940.7220.6250.592517.8:82.2, 69.4:30.6, 50:50, 15:85, 44.2:55.8
kc30.6850.5460.4410.4230.464121.6:78.4
mc10.3850.5590.3400.6800.71695.6:94.4, 0:100, 3.5:96.5, 0:100, 2.6:97.4, 2:98, 0:100, 0:100, 50:50
mw10.5930.5190.5320.5170.52617.9:92.1
pc10.5560.6030.5480.4140.453313.5:86.5, 11.7:88.3, 2.3:97.7
pc20.6580.5750.8970.6580.83750:100, 0.8:99.2, 6.3:93.7, 0:100, 5.4:94.6
pc30.6330.5490.5650.5340.538111.9:88.1
pc40.6340.6060.6910.4710.23455.3:94.7, 5.8:94.2, 9.8:90.2, 12.1:87.9, 31.4:68.6
pc50.6710.6410.6170.6530.559126.1:73.9
ant-1.70.5740.4600.4270.4860.63992.8:97.2, 43.1:56.9, 5.8:94.2, 12.7:87.3, 86.7:13.3, 15:85, 16.7:83.3, 13.1:86.9, 40:60
camel-1.60.6190.5880.6110.5400.562117.3:65.4
ivy-2.00.5890.6710.6330.6300.564313.8:86.3, 5.6:94.4, 7.1:92.9
jedit-4.30.8260.4580.4580.6330.65010.8:99.2
log4j-1.20.7730.5000.8740.9750.989980:20, 93.1:6.9, 100:0, 87:13, 50:50, 100:0, 100:0, 100:0, 100:0
lucene-2.40.7340.8220.7200.5920.548351.9:48.1, 40.4:59.6, 67.8:32.2
poi-3.00.8170.6530.5260.5510.567160.2:39.8
tomcat-6.00.6400.6660.7260.3460.513537:63, 8.6:91.4, 2.3:97.7, 5.4:94.6, 9.6:90.4
xalan-2.60.7560.6350.7230.7100.644145.9:54.1
xerces-1.40.8430.8640.8430.8860.759789.3:10.7, 50:50, 92.1:7.9, 48.3:51.7, 90.5:9.5, 78.6:21.4, 100:0
Table 4. G-mean results of two-folds cross-validation for the proposed approach based on the ensemble classifiers.
Table 4. G-mean results of two-folds cross-validation for the proposed approach based on the ensemble classifiers.
DatasetsKMBBest # of ClustersDistribution of Classes Defects: Non-Defects
1C3C5C7C9C
cm10.4170.6530.7580.7480.845921.4:78.6, 5.9:94.1, 50:50, 0:100, 0:100, 41.7:58.3, 0:100, 13:87, 40:60
jm10.5050.5850.5960.6120.606719.7:80.3, 18.6:81.4, 50.6:49.4, 11.3:88.7, 100:0, 34.7:65.3, 68.2:31.8
kc10.5620.5970.7460.6330.623513.2:86.8, 42.9:57.1, 58.3:41.7, 26.2:73.8, 21.1:78.9
kc30.7590.5690.4810.4470.491125.8:74.2
mc10.3730.5040.3150.6960.71891.2:98.8, 1.6:98.4, 8.2:91.8, 0.9:99.1, 0:100, 0:100, 1.2:98.8, 13.6:86.4, 0:100
mw10.6610.5260.5390.5220.52418.7:91.3
pc10.5650.6420.4970.4290.484321.6:78.4, 11.2:88.8, 7.9:92.1
pc20.4020.4840.9130.6720.84050:100, 1.7:98.3, 2.3:97.7, 4.5:95.5, 16.7:83.3
pc30.6710.4920.6650.5730.589113.6:86.4
pc40.6950.6640.6970.5030.229510.1:89.9, 25.9:74.1, 2.6:97.4, 1:99, 19.6:80.4
pc50.6880.6900.5640.7010.577738.5:61.5, 21.8:78.2, 29.1:70.9, 36.7:63.3, 24.4:75.6, 72.7:27.3, 16.8:83.2
ant-1.70.6030.5540.4610.5360.726926.3:73.7, 35:65, 8.3:91.7, 11.9:88.1, 4.8:95.2, 10.3:89.7, 92.3:7.7, 57.1:42.9, 21.9:78.1
camel-1.60.5000.4960.6070.5240.594511.5:88.5, 20.1:79.9, 3.8:96.2, 27.6:72.4, 21.6:78.4
ivy-2.00.6570.8610.7190.6810.636315.4:84.6, 0:100, 18.7:81.3
jedit-4.30.7160.3230.4750.6080.62711.6:98.4
log4j-1.20.6670.4720.8900.9770.987991.7:8.3, 100:0, 100:0, 100:0, 100:0, 100:0, 100:0, 85.7:14.3, 90.5:9.5
lucene-2.40.8090.8690.7810.6330.591342.5:57.5, 66:34, 51.1:48.9
poi-3.00.8380.7410.6250.6350.639161.1:38.9
tomcat-6.00.6510.7030.7060.3670.549512.3:87.7, 5.1:94.9, 11.6:88.4, 0:100, 4.3:95.7
xalan-2.60.7930.7360.7740.7670.727146.2:53.8
xerces-1.40.9150.9690.9500.9450.775354.1:45.9, 93.2:6.8, 95.9:4.1
Table 5. Precision, Recall, and G-mean for the basic classifiers and KMB.
Table 5. Precision, Recall, and G-mean for the basic classifiers and KMB.
DatasetsNBk-NNDTKMB
PreRecG-MeanPreRecG-MeanPreRecG-MeanPreRecG-Mean
cm10.4040.3120.5250.4060.3000.5170.3790.2850.5010.5270.4370.630
jm10.5040.2070.4420.5110.2090.4440.5100.2100.4450.7160.7280.804
kc10.5920.3890.5910.6010.3950.5960.5960.3880.5900.7130.6940.787
kc30.4820.5810.6900.4800.5620.6810.4790.5780.6880.7330.7980.848
mc10.0290.8800.5940.0290.8700.5960.0300.8770.5980.6930.6600.794
mw10.0810.3380.4800.0850.4330.5400.0830.4170.5290.5780.6750.722
pc10.2500.3290.5400.2750.3560.5640.2660.3380.5500.6610.7210.823
pc20.0930.8720.7890.0890.8610.7790.0880.8440.7720.4240.5160.555
pc30.1440.9080.4060.1460.9200.4090.1440.9070.4050.6800.7200.827
pc40.2700.7230.7270.2810.7540.7450.2820.7490.7450.8000.7850.870
pc50.5350.2130.4430.5370.2170.4480.5350.2150.4460.7600.7750.836
ant-1.70.4130.7870.7450.4330.7630.7510.4330.7550.7480.7080.6820.795
camel-1.60.3150.2050.4280.3300.2120.4360.3330.2180.4420.6870.6950.796
ivy-2.00.5930.5800.7320.5800.5570.7160.6110.5740.7310.7090.5720.684
jedit-4.30.3000.2440.2690000000.7160.8850.933
log4j-1.20.9610.9620.7490.9630.9700.7650.9620.9700.7560.9730.9790.600
lucene-2.40.7990.6000.6950.8000.5890.6900.7860.5930.6850.8350.8370.801
poi-3.00.9150.6260.7490.9020.6010.7280.9010.6070.7320.9060.9170.867
tomcat-6.00.4360.4180.6200.4610.4380.6370.4560.4310.6310.6860.7470.848
xalan-2.60.8640.5130.6880.8780.5270.7000.8760.5120.6900.8510.8550.859
xerces-1.40.9340.6980.7830.9420.6320.7560.9430.6260.7540.9720.9640.935
Table 6. Precision, Recall, and G-mean for the ensemble classifiers and KME.
Table 6. Precision, Recall, and G-mean for the ensemble classifiers and KME.
DatasetsBaggingAdaBoostRFXGBKME
PreRecG-MeanPreRecG-MeanPreRecG-MeanPreRecG-MeanPreRecG-Mean
cm10.3920.2950.5110.4040.3000.5160.4000.2950.5110.3970.2890.5070.7830.6230.775
jm10.5050.2070.4410.5050.2080.4430.5050.2090.4440.5060.2070.4410.8460.6690.780
kc10.5920.3880.5900.6040.3930.5950.5980.3910.5930.5890.3880.5900.8080.6630.758
kc30.4640.5560.6740.4800.5670.6840.4880.5760.6910.4780.5430.6720.8320.7920.862
mc10.0290.8700.5960.0300.8920.6050.0290.8630.5950.030.8850.6010.8660.6280.761
mw10.0870.4380.5440.0860.4330.5420.0850.4330.5390.0780.3960.5130.7290.5190.594
pc10.2630.3350.5470.2460.3130.5270.2650.3450.5560.2470.3150.5290.8280.6590.803
pc20.0940.8860.7950.0880.8360.7710.0920.8860.7920.0950.8830.7960.9010.4170.619
pc30.1450.9160.4090.1440.9090.4040.1450.9090.4090.1450.9110.4120.7760.5460.726
pc40.2800.7360.7390.2760.7390.7380.2800.7420.7410.2830.7490.7450.8810.7270.840
pc50.5290.2110.4410.5360.2150.4460.5330.2120.4430.5420.2180.4500.8320.7300.811
ant-1.70.4380.7700.7560.4340.7560.7490.4340.7680.7530.4360.7600.7520.8010.6350.780
camel-1.60.3200.2100.4330.3250.2140.4380.3360.2250.4490.3330.2190.4430.8410.6210.746
ivy-2.00.6160.5690.7280.6180.5840.7370.6060.5530.7170.5950.5560.7180.8580.7030.828
jedit-4.30000000000000.9190.8850.938
log4j-1.20.9610.9690.7520.9610.9690.7510.9620.9670.7530.9620.9690.7610.9691.0000.325
lucene-2.40.8020.5830.6890.7940.5880.6870.7980.5940.6910.7970.5920.6910.8620.8530.831
poi-3.00.9060.5930.7260.8960.5920.7210.9040.6020.730.9060.6030.7320.9290.9250.895
tomcat-6.00.4410.4120.6170.4410.4260.6260.4470.4310.6300.4490.4360.6350.7880.5670.743
xalan-2.60.8790.5210.6970.8730.5080.6870.8770.5130.6910.8800.5140.6930.8780.8200.857
xerces-1.40.9370.6260.7500.9410.6230.7510.9410.6380.7580.9420.6260.7530.9760.9820.923
Table 7. G-mean for KMB and KME.
Table 7. G-mean for KMB and KME.
DatasetsG-Mean
KMBKME
cm10.6300.775
jm10.8040.780
kc10.7870.758
kc30.8480.862
mc10.7940.761
mw10.7220.594
pc10.8230.803
pc20.5550.619
pc30.8270.726
pc40.8700.840
pc50.8360.811
ant-1.70.7950.780
camel-1.60.7960.746
ivy-2.00.6840.828
jedit-4.30.9330.938
log4j-1.20.6000.325
lucene-2.40.8010.831
poi-3.00.8670.895
tomcat-6.00.8480.743
xalan-2.60.8590.857
xerces-1.40.9350.923
Table 8. Comparison between defect prediction based on deep forest (DPDF) [38] and KME.
Table 8. Comparison between defect prediction based on deep forest (DPDF) [38] and KME.
DatasetsPreRec
DPDFKMEDPDFKME
mc10.2900.8660.0200.628
mw10.6300.7290.4300.519
pc10.2500.8280.1300.659
pc20.9800.9010.7200.417
pc30.2600.7760.0700.546
pc40.7700.8810.2100.727
pc50.6100.8320.3700.730
ant-1.70.6400.8010.4800.635
camel-1.60.4600.8410.1200.621
lucene-2.40.6900.8620.8200.853
poi-3.00.8400.9290.8200.925
tomcat-6.00.8400.7880.1200.567
xalan-2.60.7600.8780.6800.820
Table 9. Friedman test ranking.
Table 9. Friedman test ranking.
Mean Rank (df = 8, N = 30)
KMEKMBAdaBagRFXGBNBKnnDTChi-SquareAsymp. Sig.
cm18.8707.0004.7004.0004.1303.8504.4504.3303.67098.8600.000
jm18.0009.0004.1003.5704.3003.7704.0303.9304.300129.7510.000
kc18.1008.6704.1303.5304.0003.9004.0804.6503.930121.1360.000
kc38.3507.9204.0703.8704.3003.7204.4504.0804.250103.4550.000
mc17.9338.4334.6503.8503.7674.5173.7834.0334.033107.8540.000
mw16.1007.7304.6704.7704.8304.2203.5304.6804.47048.2300.000
pc18.4308.5703.3804.2704.3503.3203.9204.6004.170132.1820.000
pc22.7503.3804.6206.5306.0506.0805.6505.0804.85051.7090.000
pc38.1008.9003.6504.2503.8804.5503.7304.1203.820129.8660.000
pc48.0808.9203.5803.8804.1704.2702.9704.6304.500135.4840.000
pc58.2008.8003.8703.7303.6304.2303.8304.5704.130129.2980.000
ant-1.76.6307.5304.2704.9704.7004.4203.7204.3204.45049.9260.000
camel-1.68.2008.7674.0803.6304.8504.2503.2203.8004.200132.1080.000
ivy-2.07.9303.4305.5204.9004.0504.5804.9704.6005.02050.4900.000
jedit-4.38.6308.1303.8503.8503.8503.8505.1303.8503.850213.0870.000
log4j-1.21.0672.5335.7005.8505.7836.2505.5506.2676.000112.9740.000
lucene-2.48.7308.2303.8003.9203.9304.1204.4204.2303.620127.2740.000
poi-3.08.7008.3003.2003.4803.9304.0005.2803.8504.250137.0460.000
tomcat-6.07.7009.0003.6303.6503.8804.5203.9004.5004.220122.2740.000
xalan-2.68.4008.6003.5204.7003.8804.0203.5004.6003.780131.7680.000
xerces-1.48.3708.6303.0303.5803.9703.4706.4303.8503.670155.9790.000

Share and Cite

MDPI and ACS Style

Alsawalqah, H.; Hijazi, N.; Eshtay, M.; Faris, H.; Radaideh, A.A.; Aljarah, I.; Alshamaileh, Y. Software Defect Prediction Using Heterogeneous Ensemble Classification Based on Segmented Patterns. Appl. Sci. 2020, 10, 1745. https://doi.org/10.3390/app10051745

AMA Style

Alsawalqah H, Hijazi N, Eshtay M, Faris H, Radaideh AA, Aljarah I, Alshamaileh Y. Software Defect Prediction Using Heterogeneous Ensemble Classification Based on Segmented Patterns. Applied Sciences. 2020; 10(5):1745. https://doi.org/10.3390/app10051745

Chicago/Turabian Style

Alsawalqah, Hamad, Neveen Hijazi, Mohammed Eshtay, Hossam Faris, Ahmed Al Radaideh, Ibrahim Aljarah, and Yazan Alshamaileh. 2020. "Software Defect Prediction Using Heterogeneous Ensemble Classification Based on Segmented Patterns" Applied Sciences 10, no. 5: 1745. https://doi.org/10.3390/app10051745

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop