Education, Science, Technology, Innovation and Life
Open Access
Sign In

Embedding Source Code to Image for Defect Analysis

Download as PDF

DOI: 10.23977/amce.2019.040


Xiaomeng Wang, Wei Xin, and Jiajie Wang

Corresponding Author

Xiaomeng Wang


Source code analysis can predict defective code regions, help developers to fix bugs and prioritize test overhead. Learning based methods fail to achieve promising performance on cross-file and cross-project tasks. Meanwhile, existing code review software works seriously depend on specific compiler or virtual compiler. If source code cannot be compiled the tools do not work. We first propose to extract function blocks from abstract syntax trees, embed them to code image and construct convolutional neural networks to learn embedded images deep, which produce some categorical models for source code defect classification. We have evaluated the proposed methodology on some experiments to analysis memory related defects in snippets function by function. Experimental results showed without compiling source code it is analyze some and find historical code defect such as CVE-2018-0732, CVE-2018-0737 and CVE-2018-0739.


static code analysis, embedded images, convolutional neural networks, function level, cross file, cross projects

All published work is licensed under a Creative Commons Attribution 4.0 International License.

Copyright © 2016 - 2031 Clausius Scientific Press Inc. All Rights Reserved.