一句话:提出基于流不敏感、上下文不敏感指针分析的 Python 静态调用图方法 PyPt,可处理属性动态解析与高阶函数等动态特性,健全性与完备性均优于 PyCG。
Python 已成为最流行的编程语言之一,调用图是软件工程中许多应用的基础数据结构。然而现有 Python 调用图构建方法在精度和召回率上普遍不够高,限制了其实际使用。本文提出 PyPt,一种面向 Python 的静态调用图构建方法,其核心是基于流不敏感、上下文不敏感的指针分析,并能够处理属性动态解析、高阶函数等动态语言特性。评估方面,作者在包含 99 个手工构造程序和 6 个真实开源项目的基准上,将 PyPt 与当前最先进的调用图工具 PyCG 进行对比。实验结果表明,PyPt 在健全性(soundness)和完备性(completeness)两方面均优于 PyCG。
Python has become one of the most popular programming languages today. Call graph is one of the essential data structures for many applications in software engineering. However, the precision and recall rate of the existing Python call graph construction methods are generally not high enough, which affects their use in practice. This paper proposes PyPt, a static call graph construction method for Python based on flow-insensitive context-insensitve pointer analysis, which can deal with some dynamic features, such as the dynamic resolution of attributes, higher-order functions, etc. This paper compares PyPt with the state-of-the-art call graph tool PyCG on a benchmark containing 99 manually constructed programs and six real-world open-source projects. The results show that PyPt is better than PyCG in both soundness and completeness.
DOI 原文 ·
@inproceedings{paperbot7061,
title = {A practical call graph construction method for Python},
author = {Jiacheng Zhong},
booktitle = {FSE},
year = {2022},
doi = {10.1145/3540250.3559077}
}