I’m building a testing system to test the integrity of records in a database. The database is constantly growing. There are issues that creep in (from bad user choices, from unexpected third party errors, and from our own bugs.)
For each of the main types of records that I store, I’d like to iterate over the records and run a suite a tests on each record. That suite of tests will be constantly growing/changing as the business evolves and as we are confident that we have identified and fixed the source of issues. I’d like each test to be in its own file, so that they are easy to keep track of.
I have liberty to design this however I like – what design patterns should I look at?
Note: The system I’m testing is PHP – I have a very strong lean toward PHP. That shouldn’t matter for the question asked, but I’ll state it anyway.
If there is software that exists that can help in this problem , I’m open to hearing that as well.
The visitor pattern is imperative in extensible testing – the ability to write a test harness that fits within a testing framework and not have to worry about things like output is really, really important.
I would recommend taking a look at phpUnit. It’s written for testing PHP but you could use it to test a database as well.
http://www.phpunit.de/manual/current/en/