Skip to main content
QUICK REVIEW

[Paper Review] A Survey on Machine Learning Techniques for Source Code Analysis

Tushar Sharma, Maria Kechagia|arXiv (Cornell University)|Oct 18, 2021
Software Engineering ResearchComputer Science350 references11 citations
TL;DR

This survey synthesizes 479 primary studies (2011–2021) on machine learning for source code analysis, categorizing 12 software engineering tasks, identifying key ML techniques, tools, and datasets, and highlighting challenges like reproducibility and hardware demands. It provides a comprehensive, structured overview to guide researchers and practitioners in the growing ML4SE field.

ABSTRACT

The advancements in machine learning techniques have encouraged researchers to apply these techniques to a myriad of software engineering tasks that use source code analysis, such as testing and vulnerability detection. Such a large number of studies hinders the community from understanding the current research landscape. This paper aims to summarize the current knowledge in applied machine learning for source code analysis. We review studies belonging to twelve categories of software engineering tasks and corresponding machine learning techniques, tools, and datasets that have been applied to solve them. To do so, we conducted an extensive literature search and identified 479 primary studies published between 2011 and 2021. We summarize our observations and findings with the help of the identified studies. Our findings suggest that the use of machine learning techniques for source code analysis tasks is consistently increasing. We synthesize commonly used steps and the overall workflow for each task and summarize machine learning techniques employed. We identify a comprehensive list of available datasets and tools useable in this context. Finally, the paper discusses perceived challenges in this area, including the availability of standard datasets, reproducibility and replicability, and hardware resources.

Motivation & Objective

  • To provide a comprehensive, up-to-date synthesis of machine learning applications in source code analysis across diverse software engineering tasks.
  • To identify and categorize the most commonly used machine learning techniques, tools, and datasets in this domain.
  • To highlight persistent challenges such as reproducibility, lack of standard datasets, and high hardware requirements.
  • To support researchers and practitioners by consolidating available resources and guiding future methodological improvements.
  • To establish a living, open-source literature repository to ensure ongoing relevance and community extension of the survey.

Proposed method

  • Conducted an extensive literature search across major digital libraries using a comprehensive set of search terms and iterative query refinement.
  • Applied strict inclusion and exclusion criteria to select 479 primary studies focused on ML techniques applied to source code analysis for software engineering tasks.
  • Systematically categorized studies into 12 software engineering task categories, with subcategories and workflow steps for each.
  • Extracted and synthesized metadata, including ML techniques, tools, datasets, and experimental setups from each study.
  • Validated data extraction through dual-review by at least two authors to ensure accuracy and consistency.
  • Developed a public, open-source website and spreadsheet (https://github.com/tushartushar/ML4SCA) to serve as a living, extensible literature repository.

Experimental results

Research questions

  • RQ1Which software engineering tasks have seen the most significant application of machine learning techniques in source code analysis?
  • RQ2What are the most commonly used machine learning models, tools, and datasets in this domain?
  • RQ3What are the recurring workflows and methodological patterns across different source code analysis tasks?
  • RQ4What are the key challenges impeding reproducibility, scalability, and accessibility in ML-based source code analysis research?
  • RQ5How can the community improve standardization, tooling, and resource availability to advance the field?

Key findings

  • The application of machine learning for source code analysis has seen a consistent and growing trend from 2011 to 2021, with 479 primary studies identified.
  • Deep learning models, particularly those based on neural networks, are widely used across tasks such as vulnerability detection, code summarization, and defect prediction.
  • A significant number of studies rely on code embeddings (e.g., CodeBERT, GraphCodeBERT) for source code representation, indicating a strong trend in pre-trained models.
  • Despite the proliferation of studies, only a minority of surveys systematically document available tools and datasets, creating a gap the current survey addresses.
  • Reproducibility and replicability remain major challenges, with inconsistent use of datasets and lack of standardized evaluation protocols.
  • Hardware resource demands are high, especially for large-scale deep learning models, limiting access for researchers without institutional infrastructure.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.