APIScanner – Towards Automated Detection of Deprecated APIs in Python Libraries

02/18/2021
by   Aparna Vadlamani, et al.
0

Python libraries are widely used for machine learning and scientific computing tasks today. APIs in Python libraries are deprecated due to feature enhancements and bug fixes in the same way as in other languages. These deprecated APIs are discouraged from being used in further software development. Manually detecting and replacing deprecated APIs is a tedious and time-consuming task due to the large number of API calls used in the projects. Moreover, the lack of proper documentation for these deprecated APIs makes the task challenging. To address this challenge, we propose an algorithm and a tool APIScanner that automatically detects deprecated APIs in Python libraries. This algorithm parses the source code of the libraries using abstract syntax tree (ASTs) and identifies the deprecated APIs via decorator, hard-coded warning or comments. APIScanner is a Visual Studio Code Extension that highlights and warns the developer on the use of deprecated API elements while writing the source code. The tool can help developers to avoid using deprecated API elements without the execution of code. We tested our algorithm and tool on six popular Python libraries, which detected 838 of 871 deprecated API elements. Demo of APIScanner: https://youtu.be/1hy_ugf-iek. Documentation, tool, and source code can be found here: https://rishitha957.github.io/APIScanner.

READ FULL TEXT
research
11/06/2019

OpenML-Python: an extensible Python API for OpenML

OpenML is an online platform for open science collaboration in machine l...
research
03/30/2022

pycefr: Python Competency Level through Code Analysis

Python is known to be a versatile language, well suited both for beginne...
research
08/18/2019

API Misuse Correction: A Statistical Approach

Modern software development relies heavily on Application Programming In...
research
02/09/2021

PyART: Python API Recommendation in Real-Time

API recommendation in real-time is challenging for dynamic languages lik...
research
02/14/2020

Sub-method, partial behavioral reflection with Reflectivity: Looking back on 10 years of use

Context. Refining or altering existing behavior is the daily work of eve...
research
05/06/2023

ToolCoder: Teach Code Generation Models to use API search tools

Automatically generating source code from natural language descriptions ...
research
06/28/2022

Improving Tese Case Generation for Python Native Libraries Through Constraints on Input Data Structures

Modern Python projects execute computational functions using native libr...

Please sign up or login with your details

Forgot password? Click here to reset