Author(s)
Term
4. term
Education
Publication year
2004
Submitted on
2012-02-14
Abstract
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.
Documents
Colophon: This page is part of the AAU Student Projects portal, which is run by Aalborg University. Here, you can find and download publicly available bachelor's theses and master's projects from across the university dating from 2008 onwards. Student projects from before 2008 are available in printed form at Aalborg University Library.
If you have any questions about AAU Student Projects or the research registration, dissemination and analysis at Aalborg University, please feel free to contact the VBN team. You can also find more information in the AAU Student Projects FAQs.