APIzation: Generating Reusable APIs from StackOverflow Code Snippets

09/02/2021
by   Valerio Terragni, et al.
0

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 APIzator and the developers extracted identical parameters and return statements, respectively. For 163 (81.50 or the return statements were identical.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
06/01/2021

Studying Duplicate Logging Statements and Their Relationships with Code Clones

In this paper, we focus on studying duplicate logging statements, which ...
research
07/09/2021

An Empirical Study of Data Constraint Implementations in Java

Software systems are designed according to guidelines and constraints de...
research
04/16/2020

Optimising the Fit of Stack Overflow Code Snippets into Existing Code

Software developers often reuse code from online sources such as Stack O...
research
02/13/2020

On Learning Meaningful Assert Statements for Unit Test Cases

Software testing is an essential part of the software lifecycle andrequi...
research
04/19/2022

Auto-Icon+: An Automated End-to-End Code Generation Tool for Icon Designs in UI Development

Approximately 50 tasks [9]. Occupying a large proportion of development ...
research
12/22/2020

Do We Need Improved Code Quality Metrics?

The software development community has been using code quality metrics f...
research
02/20/2023

Learning Deep Semantics for Test Completion

Writing tests is a time-consuming yet essential task during software dev...

Please sign up or login with your details

Forgot password? Click here to reset