Visible to the public Code2Graph: Automatic Generation of Static Call Graphs for Python Source Code

TitleCode2Graph: Automatic Generation of Static Call Graphs for Python Source Code
Publication TypeConference Paper
Year of Publication2018
AuthorsGharibi, Gharib, Tripathi, Rashmi, Lee, Yugyung
Conference NameProceedings of the 33rd ACM/IEEE International Conference on Automated Software Engineering
PublisherACM
ISBN Number978-1-4503-5937-5
Keywordscall graph construction, composability, Human Behavior, pubcrawl, python, Resiliency, static code analysis
Abstract

A static call graph is an imperative prerequisite used in most interprocedural analyses and software comprehension tools. However, there is a lack of software tools that can automatically analyze the Python source-code and construct its static call graph. In this paper, we introduce a prototype Python tool, named code2graph, which automates the tasks of (1) analyzing the Python source-code and extracting its structure, (2) constructing static call graphs from the source code, and (3) generating a similarity matrix of all possible execution paths in the system. Our goal is twofold: First, assist the developers in understanding the overall structure of the system. Second, provide a stepping stone for further research that can utilize the tool in software searching and similarity detection applications. For example, clustering the execution paths into a logical workflow of the system would be applied to automate specific software tasks. Code2graph has been successfully used to generate static call graphs and similarity matrices of the paths for three popular open-source Deep Learning projects (TensorFlow, Keras, PyTorch). A tool demo is available at https://youtu.be/ecctePpcAKU.

URLhttps://dl.acm.org/citation.cfm?doid=3238147.3240484
DOI10.1145/3238147.3240484
Citation Keygharibi_code2graph:_2018