MySQL: how to check database architecture (foreign key consistency, stored procedures, etc.)

I am just designing a great database architecture. It will contain a set of tables, several views, and quite some stored procedures. Since this is a database of a larger type and at the very early stage of development (in fact, it is still only at the early stage of development), I feel the need for a set of tests to check the integrity during refactoring.

I am well acquainted with the testing concepts regarding application logic, both on the server side (mainly PHPUnit) and on the client side (Selenium and the Android testing infrastructure).

But how to test your database architecture?

  • Are there any similar testing strategies and tools for databases in general and MySQL in particular?

  • How do I verify that my views, stored procedures, triggers, and theology are still valid after changing the base table?

  • Do I need to wrap the database with, say, the PHP level to enable testing the database logic (stored procedures, triggers, etc.)?

+5
source share
2 answers

To test the database, you will need the following elements:

  • A test database containing all of your test data, raw data, etc. This will allow you to check every time from a known starting position.
  • (INSERT, DELETE, UPDATE), , . .
  • - , . .
  • , , , , . , " " , .

PHP - , DML DDL .

+2

.

  • - . - ORM. : , , , ( , Product Category, , ). : ORM (, NHibernate), - : , , : , NHibernate.

  • . DbUnit. :

DbUnit - JUnit ( Ant), , , , , . DbUnit XML. 2.0, DbUnit . DbUnit , .

, " . (2003), - .

+4
source

All Articles