Search papers, labs, and topics across Lattice.
This paper introduces PSASpotter, a tool designed to detect the usage of platform-specific APIs in Python, which are critical for ensuring cross-platform compatibility. By identifying not only the APIs in use but also their context within defensive coding structures, PSASpotter aids software maintainers in recognizing potential risks and alternative solutions. The findings suggest that PSASpotter can facilitate empirical studies on API usage and enhance software development practices across diverse platforms.
PSASpotter reveals hidden risks in Python code by detecting platform-specific APIs and their defensive usage, paving the way for safer cross-platform development.
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.