论文标题
自动化更改规则推断基于距离的API滥用检测
Automated Change Rule Inference for Distance-Based API Misuse Detection
论文作者
论文摘要
开发人员以应用程序编程接口(API)为基础,以重复使用代码库的现有功能。尽管重复使用已建立的图书馆(例如,节省时间,高质量)的好处,开发人员可能会与API的预期用法不同;可能导致错误或更具体地说是API滥用。最近的研究重点是开发自动检测API滥用的技术,但许多人的假阳性率很高。在本文中,我们通过提出CHARLI(变更规则推断)来改进这种情况,这是一种根据API使用图(AUGS)自动从开发人员修复API滥用的技术的技术。通过随后应用图形距离算法,我们使用更改规则来区分API滥用与正确的用法。这使开发人员可以在同一项目或另一个项目中其他代码位置重复使用他人对API滥用的修复。我们评估了变更规则基于三个数据集检测API滥用的能力,发现最佳的相对精度(即可测试用法)的能力在77.1%至96.1%之间,而平均召回范围为0.007%至17.7%。这些结果是Charli和我们的滥用检测是对现有API滥用探测器的有用补充。
Developers build on Application Programming Interfaces (APIs) to reuse existing functionalities of code libraries. Despite the benefits of reusing established libraries (e.g., time savings, high quality), developers may diverge from the API's intended usage; potentially causing bugs or, more specifically, API misuses. Recent research focuses on developing techniques to automatically detect API misuses, but many suffer from a high false-positive rate. In this article, we improve on this situation by proposing ChaRLI (Change RuLe Inference), a technique for automatically inferring change rules from developers' fixes of API misuses based on API Usage Graphs (AUGs). By subsequently applying graph-distance algorithms, we use change rules to discriminate API misuses from correct usages. This allows developers to reuse others' fixes of an API misuse at other code locations in the same or another project. We evaluated the ability of change rules to detect API misuses based on three datasets and found that the best mean relative precision (i.e., for testable usages) ranges from 77.1 % to 96.1 % while the mean recall ranges from 0.007 % to 17.7 % for individual change rules. These results underpin that ChaRLI and our misuse detection are helpful complements to existing API misuse detectors.