Affiliation:
1. University of California, Berkeley
2. IBM Corporation
Abstract
Reuse of existing code from class libraries and frameworks is often difficult because APIs are complex and the client code required to use the APIs can be hard to write. We observed that a common scenario is that the programmer knows what type of object he needs, but does not know how to write the code to get the object.In order to help programmers write API client code more easily, we developed techniques for synthesizing
jungloid
code fragments automatically given a simple query that describes that desired code in terms of input and output types. A jungloid is simply a unary expression; jungloids are simple, enabling synthesis, but are also versatile, covering many coding problems, and composable, combining to form more complex code fragments. We synthesize jungloids using both API method signatures and jungloids
mined
from a corpus of sample client programs.We implemented a tool,
prospector
, based on these techniques.
prospector
is integrated with the Eclipse IDE code assistance feature, and it infers queries from context so there is no need for the programmer to write queries. We tested
prospector
on a set of real programming problems involving APIs;
prospector
found the desired solution for 18 of 20 problems. We also evaluated
prospector
in a user study, finding that programmers solved programming problems more quickly and with more reuse when using
prospector
than without
prospector
.
Publisher
Association for Computing Machinery (ACM)
Subject
Computer Graphics and Computer-Aided Design,Software
Reference19 articles.
1. R. Alur P. Černý P. Madhusudan and W. Nam. Synthesis of interface specifications for java classes. R. Alur P. Černý P. Madhusudan and W. Nam. Synthesis of interface specifications for java classes.
2. Mining specifications
3. The program dependence graph and its use in optimization
4. The use of program dependence graphs in software engineering
Cited by
176 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. Equivalence by Canonicalization for Synthesis-Backed Refactoring;Proceedings of the ACM on Programming Languages;2024-06-20
2. On the Generalizability of Deep Learning-based Code Completion Across Programming Language Versions;Proceedings of the 32nd IEEE/ACM International Conference on Program Comprehension;2024-04-15
3. Recommending Third-Party Libraries and Frameworks Using Topic Modeling in Software Projects;2024 4th International Conference on Advanced Research in Computing (ICARC);2024-02-21
4. API-Driven Program Synthesis for Testing Static Typing Implementations;Proceedings of the ACM on Programming Languages;2024-01-05
5. How Practitioners Expect Code Completion?;Proceedings of the 31st ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering;2023-11-30