Reference. Program Sketching by Automatically Generating Mocks from Tests
Sketch is a popular program synthesis tool that solves for unknowns in a sketch or partial program. However, while Sketch is powerful, it does not directly support modular synthesis of dependencies, potentially limiting scalability. In this paper, we introduce Sketcham, a new technique that modularizes a regular sketch by automatically generating mocks —functions that approximate the behavior of complete implementations—from the sketch’s test suite. For example, if the function f originally calls g , Sketcham creates a mock from g ’s tests and augments the sketch with a version of f that calls . This change allows the unknowns in f and g to be solved separately, enabling modular synthesis with no extra work from the Sketch user. We evaluated Sketcham on ten benchmarks, performing enough runs to show at a 95% confidence level that Sketcham improves median synthesis performance on six of our ten benchmarks by a factor of up to 5× compared to plain Sketch, including one benchmark that times out on Sketch, while exhibiting similar performance on the remaining four. Our results show that Sketcham can achieve modular synthesis by automatically generating mocks from tests.
Cite
Cites 31 works (0 here)
External (31)
- A framework for automated test mocking of mobile apps (2020)
- Reconciling enumerative and deductive program synthesis (2020)
- Synthesizing JIT Compilers for In-Kernel DSLs (2020)
- The Sketch Programmers Manual (2020)
- EdSketch: execution-driven sketching for Java (2019)
- Program synthesis with algebraic library specifications (2019)
- Synthesizing replacement classes (2019)
- FrAngel: component-based synthesis with control structures (2019)
- Program Synthesis with Equivalence Reduction (2019)
- Learning to Infer Graphics Programs from Hand-Drawn Images (2018)
- Synthesis of Recursive ADT Transformations from Reusable Templates (2017)
- Connecting Program Synthesis and Reachability: Automatic Program Repair Using Test-Input Generation (2017)
- Synthesis of Domain Specific CNF Encoders for Bit-Vector Solvers (2016)
- Synthesizing framework models for symbolic execution (2016)
- Program synthesis from polymorphic refinement types (2016)
- JSketch: sketching for Java (2015)
- Modular Synthesis of Sketches Using Models (2014)
- Using program synthesis for social recommendations (2012)
- Synthesis of loop-free programs (2011)
- Linear Quantifier Elimination as an Abstract Decision Procedure (2010)
- Programming with angelic nondeterminism (2010)
- Complete functional synthesis (2010)
- The Sketching Approach to Program Synthesis (2009)
- Program synthesis by sketching (2008)
- Statistically rigorous java performance evaluation (2007)
- Sketching stencils (2007)
- The Calculus of Computation: Decision Procedures with Applications to Verification (2007)
- Combinatorial sketching for finite programs (2006)
- Automatic test factoring for java (2005)
- A fast string searching algorithm (1977)
- THE USE OF CONFIDENCE OR FIDUCIAL LIMITS ILLUSTRATED IN THE CASE OF THE BINOMIAL (1934)