MODA: automated test generation for database applications via mock objects

Software testing has been commonly used in assuring the quality of database applications. It is often prohibitively expensive to manually write quality tests for complex database applications. Automated test generation techniques, such as Dynamic Symbolic Execution (DSE), have been proposed to reduce human efforts in testing database applications. However, such techniques have two major limitations: (1) they assume that the database that the application under test interacts with is accessible, which may not always be true; and (2) they usually cannot create necessary database states as a part of the generated tests. To address the preceding limitations, we propose an approach that applies DSE to generate tests for a database application. Instead of using the actual database that the application interacts with, our approach produces and uses a mock database in test generation. A mock database mimics the behavior of an actual database by performing identical database operations on itself. We conducted two empirical evaluations on both a medical device and an open source software system to demonstrate that our approach can generate, without producing false warnings, tests with higher code coverage than conventional DSE-based techniques.

[1]  Suzanne M. Embury,et al.  An intensional approach to the specification of test cases for database applications , 2006, ICSE '06.

[2]  Carsten Binnig,et al.  Reverse Query Processing , 2007, 2007 IEEE 23rd International Conference on Data Engineering.

[3]  Steve Freeman,et al.  Endo-testing: unit testing with mock objects , 2001 .

[4]  Nikolai Tillmann,et al.  Mock-object generation with behavior , 2006, 21st IEEE/ACM International Conference on Automated Software Engineering (ASE'06).

[5]  Koushik Sen,et al.  DART: directed automated random testing , 2005, PLDI '05.

[6]  Koushik Sen,et al.  CUTE: a concolic unit testing engine for C , 2005, ESEC/FSE-13.

[7]  Elaine J. Weyuker,et al.  An AGENDA for testing relational database applications , 2004, Softw. Test. Verification Reliab..

[8]  Margus Veanes,et al.  Symbolic Query Exploration , 2009, ICFEM.

[9]  Nikolai Tillmann,et al.  Parameterized unit tests , 2005, ESEC/FSE-13.

[10]  Carlo Zaniolo,et al.  On the design of relational database schemata , 1981, TODS.

[11]  Leo Giakoumakis,et al.  A genetic approach for random testing of database systems , 2007, VLDB.

[12]  Rupak Majumdar,et al.  Dynamic test input generation for database applications , 2007, ISSTA '07.