ABSTRACT
Sketching is a relatively recent approach to program synthesis, which has shown much promise. The key idea in sketching is to allow users to write partial programs that have ''holes'' and provide test harnesses or reference implementations, and let synthesis tools create program fragments that fill the holes such that the resulting complete program has the desired functionality. Traditional solutions to the sketching problem perform a translation to SAT and employ CEGIS. While effective for a range of programs, when applied to real applications, such translation-based approaches have a key limitation: they require either translating all relevant libraries that are invoked directly or indirectly by the given sketch -- which can lead to impractical SAT problems -- or creating models of those libraries -- which can require much manual effort.
This paper introduces execution-driven sketching, a novel approach for synthesis of Java programs with respect to the given test suite using a backtracking search that is commonly employed in software model checkers. The key novelty of our work is to introduce effective pruning strategies to efficiently explore the actual program behaviors in presence of libraries and to provide a practical solution to sketching small parts of real-world applications, which may use complex constructs of modern languages, such as reflection or native calls. Our tool 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's performance compares well with the well-known SAT-based Sketch system for a range of small but complex programs, and moreover, that EdSketch can complete some sketches that require handling complex constructs.
- Rajeev Alur, Rastislav Bodík, Garvit Juniwal, Milo M. K. Martin, Mukund Raghothaman, Sanjit A. Seshia, Rishabh Singh, Armando Solar-Lezama, Emina Torlak, and Abhishek Udupa. 2013. Syntax-guided synthesis. In FMCAD. 1–8.Google Scholar
- Shaon Barman, Rastislav Bodík, Satish Chandra, Joel Galenson, Doug Kimelman, Casey Rodarmor, and Nicholas Tung. 2010. Programming with angelic nondeterminism. In POPL. 339–352. Google ScholarDigital Library
- Chandrasekhar Boyapati, Sarfraz Khurshid, and Darko Marinov. 2002. Korat: automated testing based on Java predicates. In ISSTA 2002. 123–133. Google ScholarDigital Library
- Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein. 2009. Introduction to Algorithms (3. ed.). MIT Press. Google ScholarDigital Library
- Bassem Elkarablieh and Sarfraz Khurshid. 2008. Juzi: a tool for repairing complex data structures. In (ICSE 2008). 855–858. Google ScholarDigital Library
- Yu Feng, Ruben Martins, Yuepeng Wang, Isil Dillig, and Thomas W. Reps. 2017. Component-based synthesis for complex APIs. In POPL. 599–612. Google ScholarDigital Library
- John K. Feser, Swarat Chaudhuri, and Isil Dillig. 2015. Synthesizing data structure transformations from input-output examples. In PLDI. 229–239. Google ScholarDigital Library
- Robert W. Floyd. 1967. Nondeterministic Algorithms. J. ACM 14, 4 (1967). Google ScholarDigital Library
- Joel Galenson, Philip Reames, Rastislav Bodík, Björn Hartmann, and Koushik Sen. 2014. ICSE. 653–663.Google Scholar
- Patrice Godefroid. 1997. Model Checking for Programming Languages using Verisoft. In POPL, 1997. 174–186. Google ScholarDigital Library
- Divya Gopinath, Muhammad Zubair Malik, and Sarfraz Khurshid. 2011. Specification-Based Program Repair Using SAT. In TACAS 2011. 173–188. Google ScholarDigital Library
- Tihomir Gvero, Viktor Kuncak, and Ruzica Piskac. 2011. Interactive Synthesis of Code Snippets. In CAV. 418–423. Google ScholarDigital Library
- Jinru Hua and Sarfraz Khurshid. 2016. A Sketching-Based Approach for Debugging Using Test Cases. In ATVA 2016. 463–478.Google ScholarCross Ref
- Daniel Jackson. 2006. Software Abstractions: Logic, Language, and Analysis. The MIT Press. Google ScholarDigital Library
- Jinseong Jeon, Xiaokang Qiu, Jeffrey S. Foster, and Armando Solar-Lezama. 2015. JSketch: sketching for Java. In FSE. 934–937. Google ScholarDigital Library
- Susmit Jha, Sumit Gulwani, Sanjit A. Seshia, and Ashish Tiwari. 2010. Oracleguided component-based program synthesis. In ICSE. 215–224. Google ScholarDigital Library
- Barbara Jobstmann, Andreas Griesmayer, and Roderick Bloem. 2005. Program Repair as a Game. In CAV. 226–238. Google ScholarDigital Library
- James A. Jones and Mary Jean Harrold. 2005. Empirical evaluation of the tarantula automatic fault-localization technique. In ASE 2005. 273–282. Google ScholarDigital Library
- Viktor Kuncak, Mikaël Mayer, Ruzica Piskac, and Philippe Suter. 2010. Complete functional synthesis. In PLDI. 316–329. Google ScholarDigital Library
- Fan Long and Martin Rinard. 2015. Staged program repair with condition synthesis. In ESEC/FSE. 166–178. Google ScholarDigital Library
- Muhammad Zubair Malik, Khalid Ghori, Bassem Elkarablieh, and Sarfraz Khurshid. 2009. A Case for Automated Debugging Using Data Structure Repair. In ASE. 620–624.Google Scholar
- David Mandelin, Lin Xu, Rastislav Bodík, and Doug Kimelman. 2005. Jungloid mining: helping to navigate the API jungle. In PLDI. 48–61. Google ScholarDigital Library
- Daniel Perelman, Sumit Gulwani, Thomas Ball, and Dan Grossman. 2012. Typedirected completion of partial expressions. In PLDI. 275–286. Google ScholarDigital Library
- Veselin Raychev, Martin T. Vechev, and Eran Yahav. 2014. Code completion with statistical language models. In PLDI. 419–428. Google ScholarDigital Library
- Rishabh Singh and Armando Solar-Lezama. 2011. Synthesizing data structure manipulations from storyboards. In FSE. 289–299. Google ScholarDigital Library
- Armando Solar-Lezama. 2013. Program sketching. STTT 15, 5-6 (2013), 475–495.Google ScholarDigital Library
- Armando Solar-Lezama, Liviu Tancau, Rastislav Bodík, Sanjit A. Seshia, and Vijay A. Saraswat. 2006. Combinatorial sketching for finite programs. In ASPLOS. 404–415. Google ScholarDigital Library
- Raghavendra Srinivasan. 2015. Improving constraint-based test input generation using Korat. Master’s thesis. University of Texas at Austin.Google Scholar
- Saurabh Srivastava, Sumit Gulwani, and Jeffrey S. Foster. 2010. From program verification to program synthesis. In POPL. 313–326. Google ScholarDigital Library
- Allison Sullivan. 2017. Automated Testing and Sketching of Alloy Models. Ph.D. Dissertation. University of Texas at Austin.Google Scholar
- Willem Visser, Klaus Havelund, Guillaume P. Brat, and Seungjoon Park. 2000. Model Checking Programs. In ASE 2000. 3–12. Google ScholarDigital Library
- Westley Weimer, Zachary P. Fry, and Stephanie Forrest. 2013. Leveraging program equivalence for adaptive program repair: Models and first results. In ASE. 356–366. Google ScholarDigital Library
- Westley Weimer, ThanhVu Nguyen, Claire Le Goues, and Stephanie Forrest. 2009. Automatically finding patches using genetic programming. In ICSE. 364–374. Google ScholarDigital Library
Index Terms
- EdSketch: execution-driven sketching for Java
Recommendations
JSketch: sketching for Java
ESEC/FSE 2015: Proceedings of the 2015 10th Joint Meeting on Foundations of Software EngineeringSketch-based synthesis, epitomized by the Sketch tool, lets developers synthesize software starting from a partial program, also called a sketch or template. This paper presents JSketch, a tool that brings sketch-based synthesis to Java. JSketch's ...
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 ...
Comments