This repository represents the replication package for the paper:
APIzation: Generating Reusable APIs from StackOverflow Code Snippets
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 %) APIzations, APIzator and the developers extracted identical parameters and return statements, respectively. For 163 (81.50 %) APIzations, either the parameters or the return statements were identical.
The paper is published in the proceeding of the 36th IEEE/ACM International Conference on Automated Software Engineering (ASE).
In this replication package, we provide all the APIzations we produced with our tool. Also, we include the data we used for our evaluation.
The repository is organized as follows:
data/
contains the data of the replication packagestudy/
contains all the data we used to conduct our investigatory study to understand how developers perform APIzationsevaluation/
includes everything regarded the evaluation part of our approach called APIzatorsearch/
provides the Java source files for the search engine we produced by using APIzator. Refer to the website for a demo
docs/
contains the source code for the website where we documented our experiments
If you would like to cite the dataset, please use the following BibTeX
snippet:
@inproceedings{terragni_apization_2021,
author = {Terragni, Valerio and Salza, Pasquale},
title = {{APIzation: Generating Reusable APIs from StackOverflow Code Snippets}},
booktitle = {IEEE/ACM International Conference on Automated Software Engineering (ASE)},
year = {2021},
}
This replication package is licensed under the terms of the Creative Commons Attribution 4.0 International License. Please see the LICENSE file for full details.
- Valerio Terragni – University of Auckland, New Zealand
- Pasquale Salza – University of Zurich, Switzerland