API usage templates via structural generalization

May Mahmoud,Robert J. Walker, Joerg Denzinger

JOURNAL OF SYSTEMS AND SOFTWARE(2024)

Cited 0|Views12
No score
Abstract
APIs matter in software development, but determining how to use them can be challenging. Developers often refer to a small set of API usage examples, analysing the information there to understand and adapt them to their own context. Generalization over many examples may aid in understanding commonalities and differences, reducing information overload while including greater variety. We propose ASGard, a novel approach that generates API usage templates from examples. Approximating the formal problem of E -generalization, ASGard generalizes all syntactic and some semantic information within the examples to arrive at pseudocode representations that retain the commonality of the usage examples but abstract the varying aspects. We evaluate the templates from our approach and the patterns generated from PAM and MUDetect (two existing tools for API data mining), using a total of 1954 API usage examples across 59 different APIs. We measure the quality of the resulting templates: ASGard's templates have superior completeness and compression. We perform a user study on ASGard with 12 participants to compare the use of these templates in solving programming tasks, compared to MUDetect. We find that participants solved the programming tasks in significantly less time with ASGard. Participants expressed a general preference for using ASGard templates.
More
Translated text
Key words
API usage,Coding templates,E-generalization
AI Read Science
Must-Reading Tree
Example
Generate MRT to find the research sequence of this paper
Chat Paper
Summary is being generated by the instructions you defined