Visible to the public APIScanner - Towards Automated Detection of Deprecated APIs in Python Libraries

TitleAPIScanner - Towards Automated Detection of Deprecated APIs in Python Libraries
Publication TypeConference Paper
Year of Publication2021
AuthorsVadlamani, Aparna, Kalicheti, Rishitha, Chimalakonda, Sridhar
Conference Name2021 IEEE/ACM 43rd International Conference on Software Engineering: Companion Proceedings (ICSE-Companion)
KeywordsAPI, API Evolution, APIs, Application program interface, application program interfaces, Application Programming Interface (API), composability, compositionality, Deprecated APIs, Documentation, Libraries, pubcrawl, python, Python Libraries, resilience, Resiliency, Software algorithms, Task Analysis, Tools, Visual Studio Code Extension, visualization
AbstractPython 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.
DOI10.1109/ICSE-Companion52605.2021.00022
Citation Keyvadlamani_apiscanner_2021