Data Mining and Machine Learning for Software Engineering

Software engineering is one of the most utilizable research areas for data mining. Developers have attempted to improve software quality by mining and analyzing software data. In any phase of software development life cycle (SDLC), while huge amount of data is produced, some design, security, or software problems may occur. In the early phases of software development, analyzing software data helps to handle these problems and lead to more accurate and timely delivery of software projects. Various data mining and machine learning studies have been conducted to deal with software engineering tasks such as defect prediction, effort estimation, etc. This study shows the open issues and presents related solutions and recommendations in software engineering, applying data mining and machine learning techniques.


Introduction
In recent years, researchers in the software engineering (SE) field have turned their interest to data mining (DM) and machine learning (ML)-based studies since collected SE data can be helpful in obtaining new and significant information.Software engineering presents many subjects for research, and data mining can give further insight to support decision-making related to these subjects.
Figure 1 shows the intersection of three main areas: data mining, software engineering, and statistics/math.A large amount of data is collected from organizations during software development and maintenance activities, such as requirement specifications, design diagrams, source codes, bug reports, program versions, and so on.Data mining enables the discovery of useful knowledge and hidden patterns from SE data.Math provides the elementary functions, and statistics determines probability, relationships, and correlation within collected data.Data science, in the center of the diagram, covers different disciplines such as DM, SE, and statistics.
This study presents a comprehensive literature review of existing research and offers an overview of how to approach SE problems using different mining techniques.Up to now, review studies either introduce SE data descriptions [1], explain tools and techniques mostly used by researchers for SE data analysis [2], discuss the role of software engineers [3], or focus only on a specific problem in SE such as defect prediction [4], design pattern [5], or effort estimation [6].Some existing review articles having the same target [7] are former, and some of them are not comprehensive.In contrast to the previous studies, this article provides a systematic review of several SE tasks, gives a comprehensive list of available studies in the field, clearly states the advantages of mining SE data, and answers "how" and "why" questions in the research area.
The novelties and main contributions of this review paper are fivefold.
• First, it provides a general overview of several SE tasks that have been the focus of studies using DM and ML, namely, defect prediction, effort estimation, vulnerability analysis, refactoring, and design pattern mining.
• Third, it points to several significant research questions that are unanswered in the recent literature as a whole or the answers to which have changed with the technological developments in the field.
• Fourth, some statistics related to the studies between the years of 2010 and 2019 are given from different perspectives: according to their subjects and according to their methods.
• Five, it focuses on different machine learning types: supervised and unsupervised learning, especially on ensemble learning and deep learning.
This paper addresses the following research questions: RQ1.What kinds of SE problems can ML and DM techniques help to solve?RQ2.What are the advantages of using DM techniques in SE? RQ3.Which DM methods and algorithms are commonly used to handle SE tasks?
RQ4. Which performance metrics are generally used to evaluate DM models constructed in SE studies?RQ5.Which types of machine learning techniques (e.g., ensemble learning, deep learning) are generally preferred for SE problems?RQ6.Which SE datasets are popular in DM studies?
The remainder of this paper is organized as follows.Section 2 explains the knowledge discovery process that aims to extract interesting, potentially useful, and nontrivial information from software engineering data.Section 3 provides an overview of current work on data mining for software engineering grouped under five tasks: defect prediction, effort estimation, vulnerability analysis, refactoring, and design pattern mining.In addition, some machine learning studies are divided into subgroups, including ensemble learning-and deep learning-based studies.Section 4 gives statistical information about the number of highly validated research conducted in the last decade.Related works considered as fundamental by journals with a highly positive reputation are listed, and the specific methods they used and their categories and purposes are clearly expressed.In addition, widely used datasets related to SE are given.Finally, Section 5 offers concluding remarks and suggests future scientific and practical efforts that might improve the efficiency of SE actions.

Knowledge discovery from software engineering data
This section basically explains the consecutive critical steps that should be followed to discover beneficial knowledge from software engineering data.It outlines the order of necessary operations in this process and explains how related data flows among them.
Software development life cycle (SDLC) describes a process to improve the quality of a product in project management.The main phases of SDCL are planning, requirement analysis, designing, coding, testing, and maintenance of a project.In every phase of software development, some software problems (e.g., software bugs, security, or design problems) may occur.Correcting these problems in the early phases leads to more accurate and timely delivery of the project.Therefore, software engineers broadly apply data mining techniques for different SE tasks to solve SE problems and to enhance programming efficiency and quality.
Figure 2 presents the data mining and knowledge discovery process of SE tasks including data collection, data preprocessing, data mining, and evaluation.In the data collection phase, data are obtained from software projects such as bug reports, historical data, version control data, and mailing lists that include various information about the project's versions, status, or improvement.In the data preprocessing phase, the data are preprocessed after collection by using different methods such as feature selection (dimensionality reduction), feature extraction, missing data elimination, class imbalance analysis, normalization, discretization, and so on.In the next phase, DM techniques such as classification, clustering, and association rule mining are applied to discover useful patterns and relationships in software engineering data and therefore to solve a software engineering problem such as defected or vulnerable systems, reused patterns, or parts of code changes.Mining and obtaining valuable knowledge from such data prevents errors and allows software engineers to deliver the project on time.Finally, in the evaluation phase, validation techniques are used to assess the data mining results such as k-fold cross validation for classification.The commonly used evaluation measures are accuracy, precision, recall, F-score, area under the curve (AUC) for classification, and sum of squared errors (SSE) for clustering.

Data mining in software engineering
In this review, we examine data mining studies in various SE tasks and evaluate commonly used algorithms and datasets.

Data mining in defect prediction
A defect means an error, failure, flaw, or bug that causes incorrect or unexpected results in a system [8].A software system is expected to be without any defects since software quality represents a capacity of the defect-free percentage of the product [9].However, software projects often do not have enough time or people working on them to extract errors before a product is released.In such a situation, defect prediction methods can help to detect and remove defects in the initial stages of the SDLC and to improve the quality of the software product.In other words, the goal of defect prediction is to produce robust and effective software systems.Hence, software defect prediction (SDP) is an important topic for software engineering because early prediction of software defects could help to reduce development costs and produce more stable software systems.
Various studies have been conducted on defect prediction using different metrics such as code complexity, history-based metrics, object-oriented metrics, and process metrics to construct prediction models [10,11].These models can be considered on a cross-project or within-project basis.In within-project defect prediction (WPDP), a model is constructed and applied on the same project [12].For within-project strategy, a large amount of historical defect data is needed.Hence, in new projects that do not have enough data to train, cross-project strategy may be preferred [13].Cross-project defect prediction (CPDP) is a method that involves applying a prediction model from one project to another, meaning that models are prepared by utilizing historical data from other projects [14,15].Studies in the field of CPDP have increased in recent years [10,16].However, there are some deficiencies in comparisons of prior studies since they cannot be replicated because of the difference in utilizing evaluation metrics or preparation way of training data.Therefore, Herbold et al. [16] tried to replicate different CPDP methods previously proposed and find which approach performed best in terms of metrics such as F-score, area under the curve (AUC), and Matthews correlation coefficient (MCC).Results showed that 7-or 8-year approaches may perform better.Another study [17] replicated prior work to demonstrate whether the determination of classification techniques is important.Both noisy and cleaned datasets were used, and the same results were obtained from the two datasets.However, new dataset gave better results for some classification algorithms.For this reason, authors claimed that the selection of classification techniques affects the performance of the model.
Numerous defect prediction studies have been conducted using DM techniques.In the following subsections, we will explain these studies in terms of whether they apply ensemble learning or not.Some defect prediction studies in SE are compared

Dataset
Evaluation metrics and results [18]  in Table 1.The objective of the studies, the year they were conducted, algorithms, ensemble learning techniques and datasets in the studies, and the type of data mining tasks are shown in this table.The bold entries in Table 1 have better performance than other algorithms in that study.

Defect prediction using ensemble learning techniques
Ensemble learning combines several base learning models to obtain better performance than individual models.These base learners can be acquired with: The commonly used ensemble techniques bagging, boosting, and stacking are shown in Figure 3 and briefly explained in this part.Bagging (which stands for bootstrap aggregating) is a kind of parallel ensemble.In this method, each model is built independently, and multiple training datasets are generated from the original dataset through random selection of different feature subsets; thus, it aims to decrease variance.It combines the outputs of each ensemble member by a voting mechanism.Boosting can be described as sequential ensemble.First, the same weights are assigned to data instances; after training, the weight of wrong predictions is increased, and this process is repeated as the ensemble size.Finally, it uses a weighted voting scheme, and in this way, it aims to decrease bias.Stacking is a technique that uses predictions from multiple models via a meta-classifier.Some software defect prediction studies have compared ensemble techniques to determine the best performing one [10,18,21,39,40].In a study conducted by Wang et al. [18], different ensemble techniques such as bagging, boosting, random tree, random forest, random subspace, stacking, and voting were compared to each other and a single classifier (NB).According to the results, voting and random forest clearly exhibited better performance than others.In a different study [39], ensemble methods were compared with more than one base learner (NB, BN, SMO, PART, J48, RF, random tree, IB1, VFI, DT, NB tree).For boosted SMO, bagging J48, and boosting and bagging RT, performance of base classifiers was lower than that of ensemble learner classifiers.
In study [21], a new method was proposed of mixing feature selection and ensemble learning for defect classification.Results showed that random forests and the proposed algorithm are not affected by poor features, and the proposed algorithm outperforms existing single and ensemble classifiers in terms of classification performance.Another comparative study [10] used seven composite algorithms (Ave, Max, Bagging C4.5, bagging naive Bayes (NB), Boosting J48, Boosting naive Bayes, and RF) and one composite state-of-the art study for cross-project defect prediction.The Max algorithm yielded the best results regarding F-score in terms of classification performance.
Bowes et al. [40] compared RF, NB, Rpart, and SVM algorithms to determine whether these classifiers obtained the same results.The results demonstrated that a unique subset of defects can be discovered by specific classifiers.However, whereas some classifiers are steady in the predictions they make, other classifiers change in their predictions.As a result, ensembles with decision-making without majority voting can perform best.
One of the main problems of SDP is the imbalance between the defect and nondefect classes of the dataset.Generally, the number of defected instances is greater than the number of non-defected instances in the collected data.This situation causes the machine learning algorithms to perform poorly.Wang and Yao [19] compared five class-imbalanced learning methods (RUS, RUS-bal, THM, BNC, SMB) and NB and RF algorithms and proposed the dynamic version of AdaBoost.NC.They utilized balance, G-mean, and AUC measures for comparison.Results showed that AdaBoost.NC and naive Bayes are better than the other seven algorithms in terms of evaluation measures.Dynamic AdaBoost.NC showed better defect detection rate and overall performance than the original AdaBoost.NC.To handle the class imbalance problem, studies [20] have compared different methods (sampling, cost sensitive, hybrid, and ensemble) by taking into account evaluation metrics such as MCC and receiver operating characteristic (ROC).
As shown in Table 1, the most common datasets used in the defect prediction studies [17][18][19]39] are the NASA MDP dataset and PROMISE repository datasets.In addition, some studies utilized open-source projects such as Bugzilla Columba and Eclipse JDT [26,27], and other studies used Android application data [22,23].

Defect prediction studies without ensemble learning
Although use of ensemble learning techniques has dramatically increased recently, studies that do not use ensemble learning are still conducted and successful.For example, in study [32], prediction models were created using source code metrics as in ensemble studies but by using different feature selection techniques such as genetic algorithm (GA).
To overcome the class imbalance problem, Tomar and Agarwal [33] proposed a prediction system that assigns lower cost to non-defective data samples and higher cost to defective samples to balance data distribution.In the absence of enough data within a project, required data can be obtained from cross projects; however, in this case, this situation may cause class imbalance.To solve this problem, Ryu and Baik [34] proposed multi-objective naïve Bayes learning for cross-project environments.To obtain significant software metrics on cloud computing environments, Ali et al. used a combination of filter and wrapper approaches [35].They compared different machine learning algorithms such as NB, DT, and MLP [29,37,38,41].

Data mining in effort estimation
Software effort estimation (SEE) is critical for a company because hiring more employees than required will cause loss of revenue, while hiring fewer employees than necessary will result in delays in software project delivery.The estimation analysis helps to predict the amount of effort (in person hours) needed to develop a software product.Basic steps of software estimation can be itemized as follows: • Determine project objectives and requirements.
• Design the activities.
• Estimate product size and complexity.
• Compare and repeat estimates.SEE contains requirements and testing besides predicting effort estimation [42].Many research and review studies have been conducted in the field of SEE.Recently, a survey [43] analyzed effort estimation studies that concentrated on ML techniques and compared them with studies focused on non-ML techniques.According to the survey, case-based reasoning (CBR) and artificial neural network (ANN) were the most widely used techniques.In 2014, Dave and Dutta [44] examined existing studies that focus only on neural network.
The current effort estimation studies using DM and ML techniques are available in Table 2.This table summarizes the prominent studies in terms of aspects such as year, data mining task, aim, datasets, and metrics.Table 2 indicates that neural network is the most widely used technique for the effort estimation task.
Several studies have compared ensemble learning methods with single learning algorithms [45,46,48,49,51,60] and examined them on cross-company (CC) and within-company (WC) datasets [50].The authors observed that ensemble methods obtained by a proper combination of estimation methods achieved better results than single methods.Various ML techniques such as neural network, support vector machine (SVM), and k-nearest neighbor are commonly used as base classifiers for ensemble methods such as bagging and boosting in software effort estimation.Moreover, their results indicate that CC data can increase performance over WC data for estimation techniques [50].
In addition to the abovementioned studies, researchers have conducted studies without using ensemble techniques.The general approach is to investigate which DM technique has the best effect on performance in software effort estimation.For instance, Subitsha and Rajan [54] compared five different algorithms-MLP, RBFNN, SVM, ELM, and PSO-SVM-and Nassif et al.
[57] investigated four neural network algorithms-MLP, RBFNN, GRNN, and CCNN.Although neural networks are widely used in this field, missing values and outliers frequently encountered in the training set adversely affect neural network results and cause inaccurate estimations.To overcome this problem, Khatibi et al. [53] split software projects into several groups based on their similarities.In their studies, the C-means clustering algorithm was used to determine the most similar projects and to decrease the impact of unrelated projects, and then analogy-based estimation (ABE) and NN were applied.Another clustering study by Azzeh and Nassif [59] combined SVM and bisecting k-medoids clustering algorithms; an estimation model was then built using RBFNN.The proposed method was trained on historical use case points (UCP).Zare et al. [58] and Maleki et al.

Ref. Year
[55] utilized optimization methods for accurate cost estimation.In the former study, a model was proposed based on Bayesian network with genetic algorithm and particle swarm optimization (PSO).The latter study used GA to optimize the effective factors' weight, and then trained by ant colony optimization (ACO).Besides conventional effort estimation studies, researchers have utilized machine learning techniques for web applications.Since web-based software projects are different from traditional projects, the effort estimation process for these studies is more complex.
It is observed that PRED (25) and MMRE are the most popular evaluation metrics in effort estimation.MMRE stands for the mean magnitude relative error, and PRED(25) measures prediction accuracy and provides a percentage of predictions within 25% of actual values.

Data mining in vulnerability analysis
Vulnerability analysis is becoming the focal point of system security to prevent weaknesses in the software system that can be exploited by an attacker.Description of software vulnerability is given in many different resources in different ways [61].The most popular and widely utilized definition appears in the Common Vulnerabilities and Exposures (CVE) 2017 report as follows: Vulnerability is a weakness in the computational logic found in software and some hardware components that, when exploited, results in a negative impact to confidentiality, integrity or availability.
Vulnerability analysis may require many different operations to identify defects and vulnerabilities in a software system.Vulnerabilities, which are a special kind of defect, are more critical than other defects because attackers exploit system vulnerabilities to perform unauthorized actions.A defect is a normal problem that can be encountered frequently in the system, easily found by users or developers and fixed promptly, whereas vulnerabilities are subtle mistakes in large codes [62,63].Wijayasekara et al. claim that some bugs have been identified as vulnerabilities after being publicly announced in bug databases [64].These bugs are called "hidden impact vulnerabilities" or "hidden impact bugs."Therefore, the authors proposed a hidden impact vulnerability identification methodology that utilizes text mining techniques to determine which bugs in bug databases are vulnerabilities.According to the proposed method, a bug report was taken as input, and it produces feature vector after applying text mining.Then, classifier was applied and revealed whether it is a bug or a vulnerability.The results given in [64] demonstrate that a large proportion of discovered vulnerabilities were first described as hidden impact bugs in public bug databases.While bug reports were taken as input in that study, in many other studies, source code is taken as input.Text mining is a highly preferred technique for obtaining features directly from source codes as in the studies [65][66][67][68][69]. Several studies [63,70] have compared text mining-based models and software metrics-based models.
In the security area of software systems, several studies have been conducted related to DM and ML.Some of these studies are compared in Table 3, which shows the data mining task and explanation of the studies, the year they were performed, the algorithms that were used, the type of vulnerability analysis, evaluation metrics, and results.In this table, the best performing algorithms according to the evaluation criteria are shown in bold.
Vulnerability analysis can be categorized into three types: static vulnerability analysis, dynamic vulnerability analysis, and hybrid analysis [61,80].Many studies have applied the static analysis approach, which detects vulnerabilities from source code without executing software, since it is cost-effective.Few studies have

Dataset description
Evaluation metrics and results [71]  performed the dynamic analysis approach, in which one must execute software and check program behavior.The hybrid analysis approach [72,76] combines these two approaches.
As revealed in Table 3, in addition to classification and text mining, clustering techniques are also frequently seen in software vulnerability analysis studies.To detect vulnerabilities in an unknown software data repository, entropy-based density clustering [71] and complete-linkage clustering [75] were proposed.Yamaguchi et al. [73] introduced a model to represent a large number of source codes as a graph called control flow graph (CPG), a combination of abstract syntax tree, CFG, and program dependency graph (PDG).This model enabled the discovery of previously unknown (zero-day) vulnerabilities.
To learn the time to next vulnerability, a prediction model was proposed in the study [42].The result could be a number that refers to days or a bin representing values in a range.The authors used regression and classification techniques for the former and latter cases, respectively.
In vulnerability studies, issue tracking systems like Bugzilla, code repositories like Github, and vulnerability databases such as NVD, CVE, and CWE have been utilized [79].In addition to these datasets, some studies have used Android [65,68,69] or web [63,70,72] (PHP source code) datasets.In recent years, researchers have concentrated on deep learning for building binary classifiers [77], obtaining vulnerability patterns [78], and learning long-term dependencies in sequential data [68] and features directly from the source code [81].
Li et al. [78] note two difficulties of vulnerability studies: demanding, intense manual labor and high false-negative rates.Thus, the widely used evaluation metrics in vulnerability analysis are false-positive rate and false-negative rate.

Data mining in design pattern mining
During the past years, software developers have used design patterns to create complex software systems.Thus, researchers have investigated the field of design patterns in many ways [82,83].Fowler defines a pattern as follows: "A pattern is an idea that has been useful in one practical context and will probably be useful in others."[84] Patterns display relationships and interactions between classes or objects.Welldesigned object-oriented systems have various design patterns integrated into them.Design patterns can be highly useful for developers when they are used in the right manner and place.Thus, developers avoid recreating methods previously refined by others.The pattern approach was initially presented in 1994 by four authorsnamely, Erich Gama, Richard Helm, Ralph Johnson, and John Vlissides-called the Gang of Four (GOF) in 1994 [85].According to the authors, there are three types of design patterns: 1. Creational patterns provide an object creation mechanism to create the necessary objects based on predetermined conditions.They allow the system to call appropriate object and add flexibility to the system when objects are created.Some creational design patterns are factory method, abstract factory, builder, and singleton.
2. Structural patterns focus on the composition of classes and objects to allow the establishment of larger software groups.Some of the structural design patterns are adapter, bridge, composite, and decorator.
3. Behavioral patterns determine common communication patterns between objects and how multiple classes behave when performing a task.Some behavioral design patterns are command, interpreter, iterator, observer, and visitor.
Many design pattern studies exist in the literature.Table 4 shows some design pattern mining studies related to machine learning and data mining.This table contains the aim of the study, mining task, year, and design patterns selected by the study, input data, dataset, and results of the studies.
In study [91], the training dataset consists of 67 object-oriented (OO) metrics extracted by using the JBuilder tool.The authors used LRNN and decision tree techniques for pattern detection.Alhusain et al. [87] generated training datasets from existing pattern detection tools.The ANN algorithm was selected for pattern instances.Chihada et al. [90] created training data from pattern instances using 45 OO metrics.The authors utilized SVM for classifying patterns accurately.Another metrics-oriented dataset was developed by Dwivedi et al. [93].To evaluate the results, the authors benefited from three open-source software systems (JHotDraw, QuickUML, and JUnit) and applied three classifiers, SVM, ANN, and RF.The advantage of using random forest is that it does not require linear features and can manage high-dimensional spaces.
To evaluate methods and to find patterns, open-source software projects such as JHotDraw, Junit, and MapperXML have been generally preferred by researchers.For example, Zanoni et al. [89] developed a tool called MARPLE-DPD by combining graph matching and machine learning techniques.Then, to obtain five design patterns, instances were collected from 10 open-source software projects, as shown in Table 4.
Design patterns and code smells are related issues: Code smell refers to symptoms in code, and if there are code smells in a software, its design pattern is not well constructed.Therefore, Kaur and Singh [96] checked whether design pattern and smell pairs appear together in a code by using J48 Decision Tree.Their obtained results showed that the singleton pattern had no presence of bad smells.
According to the studies summarized in the table, the most frequently used patterns are abstract factory and adapter.It has recently been observed that studies on ensemble learning in this field are increasing.

Data mining in refactoring
One of the SE tasks most often used to improve the quality of a software system is refactoring, which Martin Fowler has described as "a technique for restructuring an existing body of code, altering its internal structure without changing its external behavior" [98].It improves readability and maintainability of the source code and decreases complexity of a software system.Some of the refactoring types are: Add Parameter, Replace Parameter, Extract method, and Inline method [99].
Code smell and refactoring are closely related to each other: Code smells represent problems due to bad design and can be fixed during refactoring.The main challenge is to obtain which part of the code needs refactoring.Some of data mining studies related to software refactoring are presented in Table 5.Some studies focus on historical data to predict refactoring [100] or to obtain both refactoring and software defects [101]  increases, the number of software defects decreases, and thus refactoring has a positive effect on software quality.While automated refactoring does not always give the desired result, manual refactoring is time-consuming.Therefore, one study [109] proposed a clusteringbased recommendation tool by combining multi-objective search and unsupervised learning algorithm to reduce the number of refactoring options.At the same time, the number of refactoring that should be selected is decreasing with the help of the developer's feedback.

Discussion
Since many SE studies that apply data mining approaches exist in the literature, this article presents only a few of them.However, Figure 4 shows the current number of papers obtained from the Scopus search engine for each year from 2010 to 2019 by using queries in the title/abstract/keywords field.We extracted publications in 2020 since this year has not completed yet.Queries included ("data mining" OR "machine learning") with ("defect prediction" OR "defect detection" OR "bug prediction" OR "bug detection") for defect prediction, ("effort estimation" OR "effort prediction" OR "cost estimation") for effort estimation, ("vulnerab*" AND "software" OR "vulnerability analysis") for vulnerability analysis, and ("software" AND "refactoring") for refactoring.As seen in the figure, the number of studies using data mining in SE tasks, especially defect prediction and vulnerability analysis, has increased rapidly.The most stable area in the studies is design pattern mining.
Figure 5 shows the publications studied in classification, clustering, text mining, and association rule mining as a percentage of the total number of papers obtained by a Scopus query for each SE task.For example, in defect prediction, the number of studies is 339 in the field of classification, 64 in clustering, 8 in text mining, and 25 in the field of association rule mining.As can be seen from the pie charts, while clustering is a popular DM technique in refactoring, no study related to text mining is found in this field.In other SE tasks, the preferred technique is classification, and the second is clustering.
Defect prediction generally compares learning algorithms in terms of whether they find defects correctly using classification algorithms.Besides this approach, in some studies, clustering algorithms were used to select futures [110] or to compare supervised and unsupervised methods [27].In the text mining area, to extract features from scripts, TF-IDF techniques were generally used [111,112].Although many different algorithms have been used in defect prediction, the most popular ones are NB, MLP, and RBF.Table 6 shows popular repositories that contain various datasets and their descriptions, which tasks they are used for, and hyperlinks to download.For   example, the PMART repository includes source files of java projects, and the PROMISE repository has different datasets with software metrics such as cyclomatic complexity, design complexity, and lines of code.Since these repositories contain many datasets, no detailed information about them has been provided in this article.
Refactoring can be applied at different levels; study [105] predicted refactoring at package level using hierarchical clustering, and another study [99] applied class-level refactoring using LS-SVM as learning algorithm, SMOTE for handling refactoring, and PCA for feature extraction.

Conclusion and future work
Data mining techniques have been applied successfully in many different domains.In software engineering, to improve the quality of a product, it is highly critical to find existing deficits such as bugs, defects, code smells, and vulnerabilities in the early phases of SDLC.Therefore, many data mining studies in the past decade have aimed to deal with such problems.The present paper aims to provide information about previous studies in the field of software engineering.This survey shows how classification, clustering, text mining, and association rule mining can be applied in five SE tasks: defect prediction, effort estimation, vulnerability analysis, design pattern mining, and refactoring.It clearly shows that classification is the most used DM technique.Therefore, new studies can focus on clustering on SE tasks.

Figure 1 .
Figure 1.The intersection of data mining and software engineering with other areas of the field.

Figure 2 .
Figure 2. KDD process for software engineering.
i. Different learning algorithms ii.Different parameters of the same algorithm iii.Different training sets

Figure 4 .
Figure 4. Number of publications of data mining studies for SE tasks from Scopus search by their years.

Figure 6
Figure6shows the number of document types (conference paper, book chapter, article, book) published between the years of 2010 and 2019.It is clearly seen that conference papers and articles are the most preferred research study type.It is clearly seen that there is no review article about data mining studies in design pattern mining.Table6shows popular repositories that contain various datasets and their descriptions, which tasks they are used for, and hyperlinks to download.For

Figure 5 .
Figure 5. Number of publications of data mining studies for SE tasks from Scopus search by their topics.

Figure 6 .
Figure 6.The number of publications in terms of document type between 2010 and 2019.

Ref. Year Task Objective Algorithms Ensemble learning Dataset Evaluation metrics and results
DTData Mining and Machine Learning for Software Engineering DOI: http://dx.doi.org/10.5772/intechopen.91448

Table 1 .
Data mining and machine learning studies on the subject "defect prediction."

Table 2 .
Data mining and machine learning studies on the subject "effort estimation."

Table 3 .
Data mining and machine learning studies on the subject "vulnerability

Table 4 .
using different data mining algorithms such as LMT, Rip, and J48.Results suggest that when refactoring Data mining and machine learning studies on the subject "design

Table 5 .
Data mining and machine learning studies on the subject "refactoring."