Write all the unit tests before debugging or running them

Before writing the unit tests, debugging all of the code in the componet should have been completed in an earlier step.  This means that the developer should have quite a bit of confidence in the code at this point.

For the same reason that all of the code was written in one batch, all of the unit test cases should be written in one batch as well in order to take advantage of flowThe approach of writing a unit test followed by testing it is less efficient.

After all the test cases have been written, then the test cases should quickly be stepped through.  Since the code has already been stepped through earlier, then that code need not be stepped through again which means that all of the method calls to the code can be stepped over and only the result checked to make sure the test successfully completed.

Prev          Next          Back to write the unit tests

Copyright 2011 by Robert G. Bryan

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s