Abstract

Program Synthesis is an exciting topic in software engineering which aims to generate programs satisfying user intent automatically. Although different approaches have been proposed in program synthesis, only small or domain-specific programs can be generated in practice, the main obstacle of which lies in the intractability of program space. With the rapid growth of reusable libraries, component-based synthesis provides a promising way, such as synthesizing Java programs that are only composed of APIs. However, the efficiency of searching for proper solutions for complex tasks is still a challenge. In certain scenarios, some API methods are frequently called together. The usage of these API methods always follows some usage patterns. Incorporating the information about API usage patterns will help to accelerate the speed of program synthesis. However, state-of-the-art synthesis tools do not capture the inherent relationships between API methods. Aiming at this problem, we propose a novel approach to accelerate the speed of API-based program synthesis via API usage pattern mining. It is a general approach that can be applied to any approach of API-based synthesis. We first collect open source projects of high quality from the Internet and use an off-the-shelf API-usage-pattern-mining tool to mine API usage patterns from these code snippets. We use two strategies to incorporate the information about API usage patterns with program synthesis, and either strategy can improve the efficiency of program synthesis. We evaluate our approach on 20 real programming tasks, which shows that our approach can accelerate the speed of program synthesis by 86% compared to the baseline.

Highlights

  • Program synthesis is a highly intellectual activity in software engineering which aims to generate programs satisfying user intent

  • We propose a novel approach to accelerate the speed of application programming interface (API)-based program synthesis via API usage pattern mining

  • We use two strategies to incorporate the information about API usage patterns with program synthesis

Read more

Summary

INTRODUCTION

Program synthesis is a highly intellectual activity in software engineering which aims to generate programs satisfying user intent. Invoke the method DocumentBuilder.parse(File) to parse the XML file into an object of Document These three API methods constitute an API usage pattern that is widely used across different domains. We propose a novel approach to accelerate the speed of API-based program synthesis via API usage pattern mining. We use two strategies to incorporate the information about API usage patterns with program synthesis. The main contribution made in this paper include: The method of incorporating information about API usage patterns to accelerate the speed of program synthesis is proposed. Two strategies of incorporating the information about API usage patterns with program synthesis is proposed. Either way can accelerate the speed of enumerating API sequences that follow usage patterns in the phase of sketch generation.

PRELIMINARIES
EMPIRICAL EVALUATION
RQ1: COMPARING OUR APPROACH WITH SYPET
RQ2: PERFORMANCE UNDER DIFFERENT PARAMETER SETTINGS
Findings
VIII. CONCLUSION
Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call