A unit test approach for database schema evolution

  • Authors:
  • Katarina Grolinger;Miriam A. M. Capretz

  • Affiliations:
  • Department of Electrical and Computer Engineering, Faculty of Engineering, The University of Western Ontario, London, ON, Canada N6A 5B9;Department of Electrical and Computer Engineering, Faculty of Engineering, The University of Western Ontario, London, ON, Canada N6A 5B9

  • Venue:
  • Information and Software Technology
  • Year:
  • 2011

Quantified Score

Hi-index 0.00

Visualization

Abstract

Context: The constant changes in today's business requirements demand continuous database revisions. Hence, database structures, not unlike software applications, deteriorate during their lifespan and thus require refactoring in order to achieve a longer life span. Although unit tests support changes to application programs and refactoring, there is currently a lack of testing strategies for database schema evolution. Objective: This work examines the challenges for database schema evolution and explores the possibility of using various testing strategies to assist with schema evolution. Specifically, the work proposes a novel unit test approach for the application code that accesses databases with the objective of proactively evaluating the code against the altered database. Method: The approach was validated through the implementation of a testing framework in conjunction with a sample application and a relatively simple database schema. Although the database schema in this study was simple, it was nevertheless able to demonstrate the advantages of the proposed approach. Results: After changes in the database schema, the proposed approach found all SELECT statements as well as the majority of other statements requiring modifications in the application code. Due to its efficiency with SELECT statements, the proposed approach is expected to be more successful with database warehouse applications where SELECT statements are dominant. Conclusion: The unit test approach that accesses databases has proven to be successful in evaluating the application code against the evolved database. In particular, the approach is simple and straightforward to implement, which makes it easily adoptable in practice.