Investigating Next Steps in Static API-Misuse Detection

by Sven Amann, Hoan Anh Nguyen, Sarah Nadi, Tien N. Nguyen, and Mira Mezini


Application Programming Interfaces (APIs) often impose constraints such as call order or preconditions. API misuses, i.e., usages violating these constraints, may cause software crashes, data-loss, and vulnerabilities. Researchers developed several approaches to detect API misuses, typically still resulting in low recall and precision. In this work, we investigate ways to improve API-misuse detection. We design MUDetect, an API-misuse detector that builds on the strengths of existing detectors and tries to mitigate their weaknesses. MUDetect uses a new graph representation of API usages that captures different types of API misuses and a systematically designed ranking strategy that effectively improves precision. Evaluation shows that MUDetect identifies real-world API misuses with twice the recall of previous detectors and 2.5x higher precision. It even achieves almost 4x higher precision and recall, when mining patterns across projects, rather than from only the target project.



@inproceedings {ANNN+20,
  title = {{Investigating Next Steps in Static API-Misuse Detection}},
  author = {Amann, Sven and Nguyen, Hoan Anh and Nadi, Sarah and Nguyen, Tien N. and Mezini, Mira},
  booktitle = {{Software Engineering 2020}},
  series = {SE},
  year = {2020},
  doi = {10.18420/SE2020_32},
  url = {},