Skip to main content
QUICK REVIEW

[Paper Review] Synthesizing Database Programs for Schema Refactoring

Yuepeng Wang, James Dong|arXiv (Cornell University)|Apr 11, 2019
Web Application Security Vulnerabilities55 references4 citations
TL;DR

This paper presents a fully automated, push-button technique for synthesizing equivalent database programs after schema refactoring. It uses value correspondence guessing, program sketching, and a novel minimum failing input-driven enumerative search to efficiently generate semantically equivalent programs with an average synthesis time of 69.4 seconds on real-world web applications.

ABSTRACT

Many programs that interact with a database need to undergo schema refactoring several times during their life cycle. Since this process typically requires making significant changes to the program's implementation, schema refactoring is often non-trivial and error-prone. Motivated by this problem, we propose a new technique for automatically synthesizing a new version of a database program given its original version and the source and target schemas. Our method does not require manual user guidance and ensures that the synthesized program is equivalent to the original one. Furthermore, our method is quite efficient and can synthesize new versions of database programs (containing up to 263 functions) that are extracted from real-world web applications with an average synthesis time of 69.4 seconds.

Motivation & Objective

  • To address the challenge of manually refactoring database programs during schema evolution, which is error-prone and time-consuming.
  • To eliminate the need for manual user guidance in schema refactoring by automating program migration.
  • To ensure semantic equivalence between the original and synthesized programs, preserving all desired behaviors.
  • To scale the synthesis process to realistic database programs with up to 263 functions.
  • To develop a lightweight, efficient method that avoids symbolic reasoning with SMT solvers, instead using enumerative search with pruning.

Proposed method

  • Proposes a three-stage pipeline: (1) lazy enumeration of candidate value correspondences between source and target schemas, (2) generation of a program sketch that captures all possible equivalent programs under a given correspondence, and (3) completion of the sketch via enumerative search.
  • Uses value correspondence as a high-level mapping between attributes in source and target schemas, derived from attribute names and schema structure.
  • Constructs a program sketch where tables, attributes, and boolean constants are placeholders, constrained by the value correspondence to ensure semantic consistency.
  • Employs a novel conflict-driven pruning strategy based on minimum failing inputs (MFIs) to reduce the search space during sketch completion.
  • Avoids symbolic encoding into SMT formulas by using direct enumeration with MFI-based backtracking, making it efficient and scalable for SQL-based programs.
  • Relies on an existing equivalence verifier (Wang et al., 2018c) to validate semantic equivalence between original and synthesized programs.

Experimental results

Research questions

  • RQ1Can we automatically generate a semantically equivalent database program after schema refactoring without user intervention?
  • RQ2How can we effectively constrain the search space for equivalent program transformations using value correspondences?
  • RQ3Can we achieve efficient synthesis for real-world database programs with complex schema changes?
  • RQ4What pruning strategy enables scalable enumerative search in the absence of symbolic reasoning?
  • RQ5How does the proposed method compare in performance and correctness to existing program synthesis or verification techniques for database programs?

Key findings

  • The proposed technique successfully synthesized new versions of all 20 real-world schema refactoring benchmarks extracted from GitHub.
  • The average synthesis time across all benchmarks was 69.4 seconds, demonstrating practical efficiency for real-world applications.
  • The method is fully automated and requires no manual input beyond the original program and source/target schemas.
  • The use of minimum failing inputs (MFIs) significantly pruned the search space, enabling scalability despite the large number of potential program completions.
  • The synthesized programs are provably equivalent to the original programs, ensuring no behavioral changes or unintended side effects.
  • The tool, named Migrator, supports schema refactoring involving splitting and merging relations, and attributes, as long as they are expressible via value correspondences.

Better researchstarts right now

From reading papers to final review, dramatically reduce your research time.

No credit card · Free plan available

This review was created by AI and reviewed by human editors.