PSASpotter: A Tool to Detect the Usage of Platform-Specific APIs in Python
2026-07-20 • Software Engineering
Software Engineering
AI summaryⓘ
The authors created PSASpotter, a tool that finds platform-specific APIs used in Python programs. These APIs only work on certain operating systems, so it's helpful to know when a program uses them. PSASpotter also checks if the program handles these platform differences carefully with special code to avoid problems. This tool can help researchers study how Python programs deal with different platforms and assist developers in making their software more reliable across devices.
Platform-specific APIPythonSoftware maintenanceDefensive codingtry/except blocksif platform checksCross-platform developmentEmpirical studiesSoftware testing
Authors
Ricardo Job, Andre Hora
Abstract
A platform-specific API is implemented for a particular platform (e.g., operating system), thus, it may not work on other platforms than the target one. Detecting the usage of such APIs is important for supporting software maintenance, as it allows maintainers to be alerted about APIs that could pose potential risks. This paper proposes PSASpotter, a tool to detect the usage of platform-specific APIs in Python systems. PSASpotter also identifies whether the platform-specific APIs are used within a defensive code, such as try/except blocks or if blocks that check the current platform. PSASpotter can support the development of novel empirical studies about the usage of platform-specific APIs in the Python ecosystem. Moreover, the defensive code detected by PSASpotter may contain alternative solutions for unavailable APIs, which can provide insights for software development and testing across multiple platforms. PSASpotter is available at: https://github.com/ricardojob/PSASpotter. Tool video: https://youtu.be/d3WyozTAKS8.