A Unit-Test Framework for Database Applications

  • Authors:
  • Claus A. Christensen;Steen Gundersborg;Kristian de Linde;Kristian Torp

  • Affiliations:
  • KMD A/S;Spar Nord Bank A/S;KMD A/S;Aalborg University

  • Venue:
  • IDEAS '06 Proceedings of the 10th International Database Engineering and Applications Symposium
  • Year:
  • 2006

Quantified Score

Hi-index 0.00

Visualization

Abstract

The outcome of a test of an application that stores data in a database naturally depends on the state of the database. It is therefore important that test developers are able to set up and tear down database states in a simple and efficient manner. In existing unit-test frameworks, setting up and tearing down such test fixtures is labor intensive and often requires copy-and-paste of code. This paper presents an extension to existing unit-test frameworks that allows unit tests to reuse data inserted by other unit tests in a very structured fashion. With this approach, the test fixture for each unit test can be minimized. In addition, the reuse between unit tests can speed up the execution of test suites. A performance test on a medium-size project shows a 40% speed up and an estimated 25% reduction in the number of lines of test code.