Abstract—The testing of large databases faces the test oracle
problem, namely, that it is difficult to verify execution results
against expected outcomes. Rigger and Su applied metamorphic
testing through query partitioning and ternary logic partitioning
techniques to alleviate the challenge. In Part (A) of our project, we
conduct an in-depth investigation and have identified a gap
between the two techniques. We propose a disjoint partitioning
approach to address it. In Part (B), we conduct a comprehensive
investigation into the metamorphic testing of DBMS by comparing
disjoint partitioning with metamorphic relation output patterns
(MROPs) by Segura et al. We propose an exhaustive collection of
MROPs for DBMS. To the best of our knowledge, this is the first
project to integrate in-depth and comprehensive approaches to
tackle the diverse challenges in DBMS testing. In Part (C), we
conduct an empirical case study of their applications to
OceanBase, the DBMS associated with the world’s fastest online
transaction processing system. Although OceanBase has been
extensively tested and widely used in the industry, we have
detected 12 hidden failures and 8 new crashes.
Index Terms—test oracle, metamorphic testing, metamorphic
relation output pattern, DBMS, SQL, OceanBase
I. INTRODUCTION
Because of the popularity of online transaction processing
(OLTP) systems [1] in the financial sector, the correctness of the
supporting database management system (DBMS) is crucial.
However, owing to the scale of large databases, the testing of
DBMS is challenging [2]. It faces the test oracle problem, which
refers to the difficulty in verifying system execution results [3]
[4]. The metamorphic testing (MT) methodology [5][6][7] was
invented in 1998 to alleviate the problem. In 2020, Rigger and
Su [8] applied MT to address the issue in DBMS testing through
the query partitioning (QP) and ternary logic partitioning (TLP)
techniques. Empirical studies showed that they revealed 175
failures in five DBMS.
Our current project is divided into three parts. In Part (A),
we conduct an in-depth investigation on [8]. We find a gap
between QP and TLP, and introduce the concept of disjoint par-
titioning (DP) to tackle the issue. In Part (B), we conduct a com-
prehensive investigation of the adequacy of the metamorphic
relations constructed via DP, comparing them with the metamor-
phic relation output patterns (MROPs) proposed by Segura et al.
[9]. We propose a more comprehensive approach for classifying
and constructing metamorphic relations in DBMS testing. In
Part (C) of the project, we perform an empirical case study on
OceanBase [10], which has been developed by the Alibaba and
Ant Group and associated with the world’s fastest OLTP [11].
We apply both the in-depth and comprehensive approaches to
test OceanBase, and have detected 12 hidden failures and 8 new
crashes.
II. PART (A): IN-DEPTH INVESTIGATION INTO
METAMORPHIC TESTING OF DBMS
A. Motivation Example
Consider the staff table on the right.
Let us write a SELECT statement in
SQL:
SELECT * FROM staff WHERE salary < 5000;
Suppose the DBMS returns the result
on the right. It reveals a failure because
Bob also has a salary lower than 5000
and is missing from the list.
Imagine that the staff table contains 10 000 records instead
of only three. We execute the same SQL SELECT statement
against the DBMS to list all the staff with a salary lower than
5000. Suppose the DBMS returns a list of 3000 staff. This time,
we cannot easily tell whether the result of 3000 staff misses any
legitimate record or contains any superfluous record. Owing to
the large volume of data, it is difficult to detect failures.
B. Metamorphic Testing
In software testing, a test oracle is the mechanism to verify
the execution result against the expected outcome [12]. The test
oracle problem refers to the situation where such a mechanism
is either missing or extremely difficult to apply [3][4]. As we
have observed in the motivating example, it would be challeng-
ing to verify the result of a given query in large databases.
In 1998, T. Y. Chen invented the metamorphic testing (MT)
methodology [5][6] [7] , which supports test case generation and
alleviates the test oracle problem. He defines metamorphic
评论