During development I've found it useful to compare the state of the database before and after a test. This is especially true when using database tools such as Hibernate/JPA as often the complexity of these tools results in unintended side-effects. Rather than try to predict the various effects on the database, it's best to compare the database before and after to verify the expected changes.
There are a number of tools which can help. Redgate's MySQL Data Compare is an excellent commercial example. I would take a dump of database, perform a test, take a second dump and compare the two. It worked well, however it was tedious taking 2 dumps each time and loading each into the tool, particularly on larger databases this was very slow (to the point I soon gave up).
So nowadays I set up replication between 2 instances, and then:
- Stop replication on slave instance (mysql> STOP SLAVE;)
- Run test
- Compare master and slave instance
- Restart replication on slave (mysql> START SLAVE;)
- Repeat