skip to main content
10.1145/3092282.3092285acmconferencesArticle/Chapter ViewAbstractPublication PagesicseConference Proceedingsconference-collections
research-article

EdSketch: execution-driven sketching for Java

Published:13 July 2017Publication History

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.

References

  1. 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 ScholarGoogle Scholar
  2. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  3. Chandrasekhar Boyapati, Sarfraz Khurshid, and Darko Marinov. 2002. Korat: automated testing based on Java predicates. In ISSTA 2002. 123–133. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein. 2009. Introduction to Algorithms (3. ed.). MIT Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Bassem Elkarablieh and Sarfraz Khurshid. 2008. Juzi: a tool for repairing complex data structures. In (ICSE 2008). 855–858. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Yu Feng, Ruben Martins, Yuepeng Wang, Isil Dillig, and Thomas W. Reps. 2017. Component-based synthesis for complex APIs. In POPL. 599–612. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. John K. Feser, Swarat Chaudhuri, and Isil Dillig. 2015. Synthesizing data structure transformations from input-output examples. In PLDI. 229–239. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Robert W. Floyd. 1967. Nondeterministic Algorithms. J. ACM 14, 4 (1967). Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Joel Galenson, Philip Reames, Rastislav Bodík, Björn Hartmann, and Koushik Sen. 2014. ICSE. 653–663.Google ScholarGoogle Scholar
  10. Patrice Godefroid. 1997. Model Checking for Programming Languages using Verisoft. In POPL, 1997. 174–186. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Divya Gopinath, Muhammad Zubair Malik, and Sarfraz Khurshid. 2011. Specification-Based Program Repair Using SAT. In TACAS 2011. 173–188. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Tihomir Gvero, Viktor Kuncak, and Ruzica Piskac. 2011. Interactive Synthesis of Code Snippets. In CAV. 418–423. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Jinru Hua and Sarfraz Khurshid. 2016. A Sketching-Based Approach for Debugging Using Test Cases. In ATVA 2016. 463–478.Google ScholarGoogle ScholarCross RefCross Ref
  14. Daniel Jackson. 2006. Software Abstractions: Logic, Language, and Analysis. The MIT Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Jinseong Jeon, Xiaokang Qiu, Jeffrey S. Foster, and Armando Solar-Lezama. 2015. JSketch: sketching for Java. In FSE. 934–937. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Susmit Jha, Sumit Gulwani, Sanjit A. Seshia, and Ashish Tiwari. 2010. Oracleguided component-based program synthesis. In ICSE. 215–224. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Barbara Jobstmann, Andreas Griesmayer, and Roderick Bloem. 2005. Program Repair as a Game. In CAV. 226–238. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. James A. Jones and Mary Jean Harrold. 2005. Empirical evaluation of the tarantula automatic fault-localization technique. In ASE 2005. 273–282. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Viktor Kuncak, Mikaël Mayer, Ruzica Piskac, and Philippe Suter. 2010. Complete functional synthesis. In PLDI. 316–329. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Fan Long and Martin Rinard. 2015. Staged program repair with condition synthesis. In ESEC/FSE. 166–178. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. 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 ScholarGoogle Scholar
  22. David Mandelin, Lin Xu, Rastislav Bodík, and Doug Kimelman. 2005. Jungloid mining: helping to navigate the API jungle. In PLDI. 48–61. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Daniel Perelman, Sumit Gulwani, Thomas Ball, and Dan Grossman. 2012. Typedirected completion of partial expressions. In PLDI. 275–286. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Veselin Raychev, Martin T. Vechev, and Eran Yahav. 2014. Code completion with statistical language models. In PLDI. 419–428. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Rishabh Singh and Armando Solar-Lezama. 2011. Synthesizing data structure manipulations from storyboards. In FSE. 289–299. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Armando Solar-Lezama. 2013. Program sketching. STTT 15, 5-6 (2013), 475–495.Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  28. Raghavendra Srinivasan. 2015. Improving constraint-based test input generation using Korat. Master’s thesis. University of Texas at Austin.Google ScholarGoogle Scholar
  29. Saurabh Srivastava, Sumit Gulwani, and Jeffrey S. Foster. 2010. From program verification to program synthesis. In POPL. 313–326. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. Allison Sullivan. 2017. Automated Testing and Sketching of Alloy Models. Ph.D. Dissertation. University of Texas at Austin.Google ScholarGoogle Scholar
  31. Willem Visser, Klaus Havelund, Guillaume P. Brat, and Seungjoon Park. 2000. Model Checking Programs. In ASE 2000. 3–12. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  33. Westley Weimer, ThanhVu Nguyen, Claire Le Goues, and Stephanie Forrest. 2009. Automatically finding patches using genetic programming. In ICSE. 364–374. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. EdSketch: execution-driven sketching for Java

    Recommendations

    Comments

    Login options

    Check if you have access through your login credentials or your institution to get full access on this article.

    Sign in
    • Published in

      cover image ACM Conferences
      SPIN 2017: Proceedings of the 24th ACM SIGSOFT International SPIN Symposium on Model Checking of Software
      July 2017
      199 pages
      ISBN:9781450350778
      DOI:10.1145/3092282

      Copyright © 2017 ACM

      Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 13 July 2017

      Permissions

      Request permissions about this article.

      Request Permissions

      Check for updates

      Qualifiers

      • research-article

      Upcoming Conference

      ICSE 2025

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader