Art Of Unit Testing - Book Wiki > Chapters > 6. Test Hierarchies and organization

6. Test Hierarchies and organization

 Starting Paragraph

  

Unit tests are just an important part of the application as the production source code. Just like regular code in the application, give careful thought to where the tests actually reside, both physically, and logically, in relation to the code under test. if you put the wrong tests in the wrong place, you may end up with some serious consequences, like people not running the tests you have written so carefully.If you don’t figure out good ways to reuse parts of your tests, create utility methods for testing or use test hierarchies, you’ll end up with test code that is either un maintainableor hard to understand.These are the kinds of things this chapter addresses, with patterns and guidelines that will help you shape the way your tests look, feel and run, and how well they play with the rest of your code and other tests.

First, let’s consider where the tests are located.

To examine where we should put the tests, we need to first realize where they will be used and who will run them. Tests will be run:

§As part of the automated build and continuous Integration process

§Multiple times a day by developers working locally on their machines

The automated build process is so important, the next section deals exclusively with this topic.

Comments? Errata?

   

   

Tag page
You must login to post a comment.