Generating test data for killing SQL mutants: A constraint-based approach

  • Authors:
  • Shetal Shah;S. Sudarshan;Suhas Kajbaje;Sandeep Patidar;Bhanu Pratap Gupta;Devang Vira

  • Affiliations:
  • Computer Science and Engg. Dept., Indian Institute of Technology, Bombay, India;Computer Science and Engg. Dept., Indian Institute of Technology, Bombay, India;Computer Science and Engg. Dept., Indian Institute of Technology, Bombay, India;Computer Science and Engg. Dept., Indian Institute of Technology, Bombay, India;Computer Science and Engg. Dept., Indian Institute of Technology, Bombay, India;Computer Science and Engg. Dept., Indian Institute of Technology, Bombay, India

  • Venue:
  • ICDE '11 Proceedings of the 2011 IEEE 27th International Conference on Data Engineering
  • Year:
  • 2011

Quantified Score

Hi-index 0.00

Visualization

Abstract

Complex SQL queries are widely used today, but it is rather difficult to check if a complex query has been written correctly. Formal verification based on comparing a specification with an implementation is not applicable, since SQL queries are essentially a specification without any implementation. Queries are usually checked by running them on sample datasets and checking that the correct result is returned; there is no guarantee that all possible errors are detected. In this paper, we address the problem of test data generation for checking correctness of SQL queries, based on the query mutation approach for modeling errors. Our presentation focuses in particular on a class of join/outer-join mutations, comparison operator mutations, and aggregation operation mutations, which are a common cause of error. To minimize human effort in testing, our techniques generate a test suite containing small and intuitive test datasets. The number of datasets generated, is linear in the size of the query, although the number of mutations in the class we consider is exponential. Under certain assumptions on constraints and query constructs, the test suite we generate is complete for a subclass of mutations that we define, i.e., it kills all non-equivalent mutations in this subclass.