Take a look at the ACS Test Harness package for 4.0, which you'll find at
http://www.arsdigita.com/acs-repository/one-package?package_id=42. It's a framework intended to attack exactly this problem.
Only problem is that I haven't had the time to finish it. (I know, it's ironic and sad.) But if anyone in the community feels like taking ownership of the package, it would benefit both OpenACS and ACS Classic.