I’m just about designing a larger database architecture. It will contain a set of tables, several views and quite some stored procedures. Since it’s a database of the larger type and in the very early stage of development (actually it’s still only in the early design stage) I feel the need of a test suite to verify integrity during refactoring.
I’m quite familiar with testing concepts as far as application logic is concerned, both on server side (mainly PHPUnit) and client side (Selenium and the Android test infrastructure).
But how do I test my database architecture?
-
Is there some kind of similar testing strategies and tools for databases in general and MySQL in particular?
-
How do I verify that my views, stored procedures, triggers and God-knows-what are still valid after I change an underlying table?
-
Do I have to wrap the database with, say, a PHP layer to enable testing of database logic (stored procedures, triggers, etc)?
To test a database, some of the things you will need are:
You should not need to wrap your database with a PHP layer – if you follow the above structure it should be possible to have your complete test suite in the DML and DDL of your actual database combined with your normal test suite.