Write a Blog >>
ICSE 2021
Mon 17 May - Sat 5 June 2021

API recommendation in real-time is challenging for dynamic languages like Python. Many existing API recommendation techniques are highly effective, but they mainly support static languages. A few Python IDEs provide API recommendation functionalities based on type inference and training on a large corpus of Python libraries and third-party libraries. As such, they may fail to recommend or make poor recommendations. In this paper, we propose a novel approach, PyART, to recommend APIs for Python programs in real-time. It features a light-weight analysis to derives so-called optimistic data-flow, which is neither sound nor complete, but simulates the local data-flow information humans can derive. It extracts three kinds of features: data-flow, token similarity, and token co-occurrence, in the context of the program point where a recommendation is solicited. A predictive model is trained on these features using the Random Forest algorithm. Evaluation on 8 popular Python projects demonstrates that PyART can provide effective API recommendations. When historic commits can be leveraged, which is the target scenario of a state-of-the-art tool ARIREC, our average top-1 accuracy is over 50% and average top-10 accuracy over 70%, outperforming APIREC and Intellicode (i.e., the recommendation component in Visual Studio) by 28.48%-39.05% for top-1 accuracy and 24.41%-30.49% for top-10 accuracy. In other applications such as when historic comments are not available and cross-project recommendation, PyART also shows better overall performance. The time to make a recommendation is less than a second on average, satisfying the real-time requirement.

Conference Day
Wed 26 May

Displayed time zone: Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna change

11:20 - 12:20
2.1.4. Tools for the Python LanguageTechnical Track at Blended Sessions Room 4 +12h
Chair(s): Igor SteinmacherFederal University of Technology - ParanĂ¡ / Northern Arizona University
11:20
20m
Research paper
Restoring Execution Environments of Jupyter NotebooksTechnical Track
Technical Track
Jiawei WangMonash University, Li LiMonash University, Andreas ZellerCISPA Helmholtz Center for Information Security
Pre-print Media Attached
11:40
20m
Paper
PyART: Python API Recommendation in Real-TimeArtifact ReusableTechnical Track
Technical Track
Xincheng HeState Key Laboratory for Novel Software Technology, Nanjing University, Lei XuState Key Laboratory for Novel Software Technology, Nanjing University, Xiangyu ZhangPurdue University, Rui HaoState Key Laboratory for Novel Software Technology Nanjing University, Yang FengState Key Laboratory for Novel Software Technology, Nanjing University, Baowen XuNanjing University
Pre-print Media Attached
12:00
20m
Paper
PyCG: Practical Call Graph Generation in PythonArtifact ReusableTechnical TrackArtifact Available
Technical Track
Vitalis SalisAthens University of Economics and Business, National and Technical University of Athens, Thodoris SotiropoulosAthens University of Economics and Business, Panos LouridasAthens University of Economics and Business, Diomidis SpinellisAthens University of Economics and Business & TU Delft, Dimitris MitropoulosNational and Kapodistrian University of Athens
Pre-print Media Attached
23:20 - 00:20
2.1.4. Tools for the Python LanguageTechnical Track at Blended Sessions Room 4
23:20
20m
Research paper
Restoring Execution Environments of Jupyter NotebooksTechnical Track
Technical Track
Jiawei WangMonash University, Li LiMonash University, Andreas ZellerCISPA Helmholtz Center for Information Security
Pre-print Media Attached
23:40
20m
Paper
PyART: Python API Recommendation in Real-TimeArtifact ReusableTechnical Track
Technical Track
Xincheng HeState Key Laboratory for Novel Software Technology, Nanjing University, Lei XuState Key Laboratory for Novel Software Technology, Nanjing University, Xiangyu ZhangPurdue University, Rui HaoState Key Laboratory for Novel Software Technology Nanjing University, Yang FengState Key Laboratory for Novel Software Technology, Nanjing University, Baowen XuNanjing University
Pre-print Media Attached
00:00
20m
Paper
PyCG: Practical Call Graph Generation in PythonArtifact ReusableTechnical TrackArtifact Available
Technical Track
Vitalis SalisAthens University of Economics and Business, National and Technical University of Athens, Thodoris SotiropoulosAthens University of Economics and Business, Panos LouridasAthens University of Economics and Business, Diomidis SpinellisAthens University of Economics and Business & TU Delft, Dimitris MitropoulosNational and Kapodistrian University of Athens
Pre-print Media Attached