As with any kind of testing, it's best to automate your user acceptance tests. With acceptance tests, though, we often run into a tricky problem. Since we are testing the functionality of the entire system including the database, it's possible that previous runs of the test suite added information to the database that affect later runs. For example, when you run a test it may add information to the database. When you run it again, the information is already present and the add fails. There are various solutions for this problem but the solution you choose depends on your application. One option is that before running a test case or a test suite you must always restore the database to a known state. This could be a painful and difficult solution to implement. For one acceptance test suite I developed, we captured the current timestamp in seconds since 1970 and tacked that number on the end of all the primary keys we used for the test. In another case, all we could do was choose extremely random data and hope that there were no conflicts with previous runs. However you do it, you need to plan an approach that will work properly for your project.
Download