Future Internet · 2023 · 14 citations · 34 references
ComputingComputer EngineeringComputer ScienceMachine LearningNatural Language ProcessingSoftware EngineeringAbstract Syntax TreesStatic Code AnalysisSupport Vector MachinesSyntax AnalysisAbstract Syntax Tree AnalysisAbstract Syntax Tree RepresentationClassification AlgorithmsHardware PartitioningSource Code AnalysisSource Code TransformationSupport Vector Machine ClassificationViolation Detection
In this paper we consider the research and development of classifiers that are trained to predict the task solved by source code. Possible applications of such task detection algorithms include method name prediction, hardware–software partitioning, programming standard violation detection, and semantic code duplication search. We provide the comparative analysis of modern approaches to source code transformation into vector-based representations that extend the variety of classification and clustering algorithms that can be used for intelligent source code analysis. These approaches include word2vec, code2vec, first-order and second-order Markov chains constructed from abstract syntax trees (AST), histograms of assembly language instruction opcodes, and histograms of AST node types. The vectors obtained with the forementioned approaches are then used to train such classification algorithms as k-nearest neighbor (KNN), support vector machine (SVM), random forest (RF), and multilayer perceptron (MLP). The obtained results show that the use of program vectors based on first-order AST-based Markov chains with an RF-based classifier leads to the highest accuracy, precision, recall, and F1 score. Increasing the order of Markov chains considerably increases the dimensionality of a vector, without any improvements in classifier quality, so we assume that first-order Markov chains are best suitable for real world applications. Additionally, the experimental study shows that first-order AST-based Markov chains are least sensitive to the used classification algorithm.
34
Scikit-learn: Machine Learning in Python
Fabián Pedregosa, Gaël Varoquaux, Alexandre Gramfort et al. · arXiv (Cornell University) · 2012 · 63.7K citations · Full text
Corinna Cortes, Vladimir Vapnik · Machine Learning · 1995 · 40.5K citations · Full text
Statistical Comparisons of Classifiers over Multiple Data Sets
Janez Demšar · 2006 · 11.2K citations