论文标题

通过枢纽查询合成测试数据库引擎

Testing Database Engines via Pivoted Query Synthesis

论文作者

Rigger, Manuel, Su, Zhendong

论文摘要

关系数据库普遍使用。它们由数据库管理系统(DBMS)管理,该系统允许使用称为结构化查询语言(SQL)的域特异性语言插入,修改和查询数据。流行的DBM已通过模糊剂进行了广泛的测试,这些模糊已成功地查找崩溃错误。但是,查找逻辑错误的方法,例如当DBMS计算错误的结果集时,仍未被划过。差异测试是一种通过比较这些系统的输出来支持通用语言的测试系统的有效技术。但是,对于DBMS,此技术无效,因为每个DBM通常都支持其自己的SQL方言。为此,我们设计了一种新颖而通用的方法,我们称其为枢纽的查询合成。这种方法的核心思想是自动生成查询,我们确保它们获取特定的,随机选择的行,称为枢轴行。如果DBMS无法获取枢轴行,则可能是DBMS中的错误。我们在三个广泛使用和成熟的DBM上测试了我们的方法,即SQLite,MySQL和PostgreSQL。我们总共报告了这些DBM中的123个错误,其中99个已固定或验证,表明该方法非常有效和一般。我们预计我们的方法的广泛适用性和简单性将使许多DBM的鲁棒性提高。

Relational databases are used ubiquitously. They are managed by database management systems (DBMS), which allow inserting, modifying, and querying data using a domain-specific language called Structured Query Language (SQL). Popular DBMS have been extensively tested by fuzzers, which have been successful in finding crash bugs. However, approaches to finding logic bugs, such as when a DBMS computes an incorrect result set, have remained mostly untackled. Differential testing is an effective technique to test systems that support a common language by comparing the outputs of these systems. However, this technique is ineffective for DBMS, because each DBMS typically supports its own SQL dialect. To this end, we devised a novel and general approach that we have termed Pivoted Query Synthesis. The core idea of this approach is to automatically generate queries for which we ensure that they fetch a specific, randomly selected row, called the pivot row. If the DBMS fails to fetch the pivot row, the likely cause is a bug in the DBMS. We tested our approach on three widely-used and mature DBMS, namely SQLite, MySQL, and PostgreSQL. In total, we reported 123 bugs in these DBMS, 99 of which have been fixed or verified, demonstrating that the approach is highly effective and general. We expect that the wide applicability and simplicity of our approach will enable the improvement of robustness of many DBMS.

扫码加入交流群

加入微信交流群

微信交流群二维码

扫码加入学术交流群,获取更多资源