EdSketch: execution-driven sketching for Java
Sketching is a synthesis approach that allows users to provide high-level insights into a synthesis problem and let synthesis tools complete low-level details. Users write sketches —partial programs that have “holes” and provide test assertions as the correctness criteria. The sketching techniques f...
Saved in:
Published in | International journal on software tools for technology transfer Vol. 21; no. 3; pp. 249 - 265 |
---|---|
Main Authors | , , , |
Format | Journal Article |
Language | English |
Published |
Berlin/Heidelberg
Springer Berlin Heidelberg
01.06.2019
Springer Nature B.V |
Subjects | |
Online Access | Get full text |
ISSN | 1433-2779 1433-2787 |
DOI | 10.1007/s10009-019-00512-8 |
Cover
Summary: | Sketching is a synthesis approach that allows users to provide high-level insights into a synthesis problem and let synthesis tools complete low-level details. Users write
sketches
—partial programs that have “holes” and provide test assertions as the correctness criteria. The sketching techniques fill the holes with code fragments such that the complete program satisfies all test assertions. Traditional techniques translate the sketching problem to propositional satisfiability formulas and leverage SAT solvers to generate programs with the desired functionality. While effective for a range of small well-defined domains, such translation-based approaches have a key limitation when applying to real applications: They require either translating all relevant libraries that are invoked directly or indirectly by the given sketch or creating models of those libraries, which requires much manual effort. This paper introduces
execution-driven sketching
, a novel approach for synthesizing Java programs with
on-demand
candidate generation. The key novelty of our work is to leverage runtime behavior to prune a large amount of search space.
EdSketch
explores the actual program behaviors
in the presence
of libraries and sketches small parts of real-world applications, which may use complex constructs of modern languages, such as reflection, native calls and File I/O. We further leverage a set of pruning strategies based on Java syntax to expedite the synthesis process.
EdSketch
embodies our approach in two forms: a stateful search based on the Java PathFinder model checker; and a stateless search based on re-execution inspired by the
VeriSoft
model checker. Experimental results show that
EdSketch
can complete some sketches that contain complex constructs in the presence of libraries, recursive procedures and advanced features like reflection. Without translating to SAT,
EdSketch
’s performance compares well with the SAT-based
Sketch
system for a range of small but complex data structure subjects. |
---|---|
Bibliography: | ObjectType-Article-1 SourceType-Scholarly Journals-1 ObjectType-Feature-2 content type line 14 |
ISSN: | 1433-2779 1433-2787 |
DOI: | 10.1007/s10009-019-00512-8 |