title: MySQL: How do I test my database architecture (foreign key consistency, stored procedures, etc)
body: <p>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.</p>
  
  <p>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).</p>
  
  <p><em><strong>But how do I test my database architecture?</em></strong></p>
  
  <ul>
  <li><p>Is there some kind of similar testing strategies and tools for databases in general and MySQL in particular?</p></li>
  <li><p>How do I verify that my views, stored procedures, triggers and God-knows-what are still valid after I change an underlying table?</p></li>
  <li><p>Do I have to wrap the database with, say, a PHP layer to enable testing of database logic (stored procedures, triggers, etc)?</p></li>
  </ul>