APIzation: Generating Reusable APIs from StackOverflow Code Snippets
Valerio Terragni, Pasquale Salza

TL;DR
This paper introduces APIzator, an automated tool that converts incomplete StackOverflow code snippets into reusable Java APIs by extracting method parameters and return statements using static analysis, thus reducing manual effort.
Contribution
The paper presents APIzator, a novel static analysis-based approach for automatic APIzation of code snippets, grounded in patterns derived from real-world examples.
Findings
APIzator correctly identified parameters in 56.5% of cases.
APIzator correctly identified return statements in 57.5% of cases.
In 81.5% of cases, either parameters or return statements matched human annotations.
Abstract
Developer forums like StackOverflow have become essential resources to modern software development practices. However, many code snippets lack a well-defined method declaration, and thus they are often incomplete for immediate reuse. Developers must adapt the retrieved code snippets by parameterizing the variables involved and identifying the return value. This activity, which we call APIzation of a code snippet, can be tedious and time-consuming. In this paper, we present APIzator to perform APIzations of Java code snippets automatically. APIzator is grounded by four common patterns that we extracted by studying real APIzations in GitHub. APIzator presents a static analysis algorithm that automatically extracts the method parameters and return statements. We evaluated APIzator with a ground-truth of 200 APIzations collected from 20 developers. For 113 (56.50 %) and 115 (57.50 %)…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsSoftware Engineering Research · Software System Performance and Reliability · Advanced Software Engineering Methodologies
