using DrupalWebTestCase - any trick to prevent it from running from scratch each time? It makes sense to run each test in a completely clean environment. However, before tests can be run, they have to be developed, during this process it is so frustrating to have to wait 3 or 4 minutes each time to see the result of any change/correction in the test. 

Is there any trick to somehow resume the test in the environment where is finished or broke last time, without recreating the whole Drupal database? At this point, I am not interested in the tests to be 100% reliable, but rather in getting rid of more or less obvious errors in tests themselves.

For example, in my WebTestCase, I wrote $myfunction instead of $myfunction() and the test failed. The test so far created a content type, so in order to re-run it in the same environment, I would just delete that content type if exists, etc. It would be quicker.
No, there isn't. Simpletest doesn't know if your last test run was successful, or maybe broke something within the test environment, or if you changed it. That alone would be problematic, beside technical reasons. Also, the really slow part isn't your custom setUp() code but setting up a complete Drupal installation every time.

There are some tricks to improve the speed, however.


Use the testing profile by adding a protected $profile = 'testing'; to your test class. Maybe you need to define a few additional dependencies though, because that only installs the absolutely required modules. This improves test speed ~50%.
Have a single public test*() method, which calls a number of functions. Then you only need a single set-up for the whole test class. However, you need to be aware that your test methods aren't run in a separate environment anymore.
"Hacking" core by changing the default engine from InnoDB to MyISAM. That makes create TABLE statements much faster.
Improve your MySQL configuration, here's my configuration as an example: http://techblog.md-systems.ch/blog/improve-mysql-performance
When actively working on a single test method and the class has multiple ones, disable the others by replacing function test... with function dtest... Don't forget to revert that before committing.


A single test method takes ~10 seconds on my laptop. That's not too bad.