Make something amazing, for anyone, at DrupalCon. Standard prices end on August 26.
There is a Drupal 6 contributed module called Simpletest, which allows you to write automated functional and unit tests for Drupal (including modules and themes). In Drupal 7, most of the Simpletest module functionality was incorporated into the Drupal 7 core "Testing" module (modules/simpletest in your Drupal installation).
For more information, visit the Simpletest section of the Developing for Drupal handbook.