A Multi User Unit Test Framework for Testing Database Applications
Student thesis: Master thesis (including HD thesis)
- Claus Abildgaard Christensen
- Steen Gundersborg
- Kristian de Linde
- Jacob Richard Thornber
4. term, Computer Science, Master (Master Programme)
Unit testing is the foundation for building correct and robust applications. Unit testing of database applications differs from traditional unit testing because of persistency and foreign key constraints. Before executing a test case, data associated via foreign keys must exist. Furthermore, after each test case it is necessary to clean up any modifications made to the database. Failure to do so will cause the second unit test to fail.
Existing test frameworks assume independency between test cases. Retaining this assumption when testing database applications, results in a high test fixture. Therefore, a new approach is preferable. We propose that test cases and unit tests should be allowed to depend on each other. This enables us to reuse test fixture and avoid redundant code. Furthermore, as test fixture is only set up and torn down once per unit test, as opposed to once per test case, our framework offers a significant performance improvement compared to existing frameworks.
We have designed and implemented the proposed test framework, minimizing test fixtures and providing automatic cleanup of the database, also in the case of a system crash. We conclude that the test framework is simpler to use than existing frameworks. It allows for faster execution of unit tests, requires less work from developers, and it can be integrated with an existing framework.
Existing test frameworks assume independency between test cases. Retaining this assumption when testing database applications, results in a high test fixture. Therefore, a new approach is preferable. We propose that test cases and unit tests should be allowed to depend on each other. This enables us to reuse test fixture and avoid redundant code. Furthermore, as test fixture is only set up and torn down once per unit test, as opposed to once per test case, our framework offers a significant performance improvement compared to existing frameworks.
We have designed and implemented the proposed test framework, minimizing test fixtures and providing automatic cleanup of the database, also in the case of a system crash. We conclude that the test framework is simpler to use than existing frameworks. It allows for faster execution of unit tests, requires less work from developers, and it can be integrated with an existing framework.
Language | English |
---|---|
Publication date | Jun 2004 |