paperbot · PL 论文追踪

全部论文 待读 收藏

P1 Code2graph: automatic generation of static call graphs for Python source code

Code2graph:自动生成 Python 源代码的静态调用图
ASE Proceedings of the 33rd ACM/IEEE International Conference on Automated Software Engineering2018匹配度 5/10 · 该论文提出 Python 静态调用图构建工具,并在 TensorFlow、Keras、PyTorch 等深度学习项目上应用,属于在机器学习系统中应用静态分析的范畴;但工具本身是通用 Python 调用图与路径相似度分析,未涉及 LLM/Agent、浮点程序分析或贝叶斯程序分析,也未提供理论形式化或问题驱动的失效分析。引用 36 inbox
Gharib Gharibi, Rashmi Tripathi, Yugyung Lee
crossref: 2026-09-12

AI 速览

一句话:提出原型工具 code2graph,自动分析 Python 源码、构建静态调用图并生成执行路径相似度矩阵。

静态调用图是过程间分析与软件理解工具的基础,但 Python 生态中缺少能自动分析源代码并构建静态调用图的工具。本文提出原型工具 code2graph,可自动完成三项任务:分析 Python 源码并抽取其结构、从源码构建静态调用图、生成系统中所有可能执行路径之间的相似度矩阵。作者的目标有二:帮助开发者理解系统整体结构,并为软件搜索与相似性检测等后续研究提供基础,例如将执行路径聚类为系统的逻辑工作流以自动化特定软件任务。该工具已成功为 TensorFlow、Keras、PyTorch 三个流行开源深度学习项目生成静态调用图与路径相似度矩阵,并提供在线工具演示。

问题
Python 缺少能够自动分析源代码并构建静态调用图的软件工具,而这正是过程间分析和软件理解的前提。
方法
实现原型工具 code2graph,自动化地抽取 Python 源码结构、构建静态调用图,并生成系统所有可能执行路径的相似度矩阵。
评估
在 TensorFlow、Keras、PyTorch 三个流行开源深度学习项目上成功生成静态调用图与路径相似度矩阵,并提供了在线工具演示视频。
原文摘要(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.

链接与引用

DOI 原文 ·

BibTeX
@inproceedings{paperbot4717,
  title = {Code2graph: automatic generation of static call graphs for Python source code},
  author = {Gharib Gharibi and Rashmi Tripathi and Yugyung Lee},
  booktitle = {ASE},
  year = {2018},
  doi = {10.1145/3238147.3240484}
}