ICSE2025

Coni: Detecting Database Connector Bugs via State-Aware Test Case Generation

Wenqian Deng, Jie Liang, Zhiyong Wu, Jingzhou Fu, Mingzhe Wang, Yu Jiang

被引用 1 次

摘要

Database connectors are widely used in many applications to facilitate flexible and convenient database interactions. Potential bugs in database connectors can lead to various abnormal behaviors within applications, such as returning incorrect results or experiencing unexpected connection interruption. However, existing DBMS fuzzing works cannot be directly applied to testing database connectors as they mainly focus on SQL generation and use a small subset of connector interfaces. Automated test case generation also struggles to generate effective test cases that explore intricate interactions of database connectors due to a lack of domain knowledge. The main challenge in testing database connectors is generating semantically correct test cases that can trigger various connector state transitions. To address that, we propose CONI, a framework designed for detecting logic bugs of database connectors with state-aware test case generation. First, we define the database connector state model by analyzing the corresponding standard specification. Building upon this model, CONI generates interface call sequences within test cases to encompass various state transitions. After that, CONI generates suitable parameter values based on the parameter information and contextual information collected during runtime. Then the test cases are executed on a target and a reference database connector. Inconsistent results indicate potential bugs. We evaluated CONI on 5 widelyused JDBC database connectors, namely MySQL Connector/J, MariaDB Connector/J, AWS JDBC Driver for MySQL, PGJDBC, and PG JDBC NG. In total, CONI reported 44 previously unknown bugs, of which 34 have been confirmed. * Jie Liang and Yu Jiang are the corresponding authors. important, as any shortcomings or bugs in their functionality can impact the overall performance of the software system. To provide applications with increased flexibility and convenience in their interactions with databases, most database vendors implement database connectors following unified standards such as JDBC (Java Database Connectivity) [2] and ODBC (Open Database Connectivity) [3] . Due to the richness of functionality provided by these standards and the variety of use cases for database connectors, database connector implementations may have many potential bugs. The issue tracking systems for popular JDBC implementations such as PGJDBC [4] and MariaDB Connector/J [5] have already collected thousands of bug reports in recent years. These bugs can result in various abnormal behaviors within the application, such as returning incorrect results or experiencing unexpected connection interruptions [6, 7, 8, 9] . MariaDB CONJ 1071 Error During Bulk Execution Might Result in Connection Wrong State id (PK) field 1 Mike 2 Jack Origin Table t0 Connector INSERT INTO t0 VALUES (1, null) INSERT INTO t0 VALUES (2, Lily)