Database Management System (DBMS) plays a core role in modern software from mobile apps to online banking. It is critical that DBMS should provide correct data to all applications. When the DBMS returns incorrect data, a correctness bug is triggered. Current production-level DBMSs still suffer from insufficient testing due to the limited hand-written test cases. Recently several works proposed to automatically generate many test cases with query transformation, a process of generating an equivalent query pair and testing a DBMS by checking whether the system returns the same result set for both queries. However, all of them still heavily rely on manual work to provide a transformation which largely confines their exploration of the valid input query space. This paper introduces duplicate-sensitivity guided transformation synthesis which automatically finds new transformations by first synthesizing many candidates then filtering the nonequivalent ones. Our automated synthesis is achieved by mutating a query while keeping its duplicate sensitivity, which is a necessary condition for query equivalence. After candidate synthesis, we keep the mutant query which is equivalent to the given one by using a query equivalent checker. Furthermore, we have implemented our idea in a tool Eqsql and used it to test the production-level DBMSs. In two months, we detected in total 30 newly confirmed and unique bugs in MySQL, TiDB and CynosDB.
翻译:数据库管理系统(DBMS) 在移动应用程序到在线银行的现代软件中扮演核心角色。 DBMS 必须在从移动应用程序到在线银行的现代软件中扮演核心角色。 关键是 DBMS 提供正确数据给所有应用程序。 当 DBMS 返回不正确的数据时, 就会触发一个正确性错误。 当前的生产级别 DBMS 仍然由于手写测试案例有限而受测试不足的影响。 最近提出的几项工作旨在自动生成许多测试案例, 包括查询转换, 生成一个对等的查询配对, 测试一个 DBMS, 检查系统是否返回为这两个查询设定的相同结果。 但是, 所有的DBMS 仍然非常依赖手动工作来提供一种转换, 以限制对有效输入查询空间的探索。 本文引入了重复性敏化导变换合成, 通过首先对许多候选人进行合成, 然后过滤非对应的测试案例。 我们的自动合成是通过变换查询来实现的, 同时保持其重复的敏感度, 这是查询的一个必要条件。 在候选人合成后, 我们保留与给的变异性查询相等的查询相等于一个结果, 通过查询核对器检查器, 。 此外, 我们在一个工具 EqsQS 和新测试的DBDBDBS 测试了我们总共30个月中在C 测试了两个工具中测试了C 。