Saturday, November 7, 2009

Section 7.2.  Organizing Tests in Test Suites









7.2. Organizing Tests in Test Suites


As the number of test files increases, we need a good way to organize them and a simple way to run them all. We can organize the Fit test files into folders, with related tests together. For example, in a chat server system, we could have folders for tests related to various important actions, as shown in Figure 7.3.



Figure 7.3. Organizing Test Suites in Folders

[View full size image]




You can then run Fit on the tests in a folder and in all subfolders. This makes it easy to run all the tests or a group of them, based on the folder structure. Running a suite of tests is much the same as running a single file. However, a reportIndex.html report file is generated. This report file summarizes the results of all the tests, providing links to the specific reports for each of the files.


As we'll see later, we often find that a group of tests all have the same setup tables. Including these tables in each of the files works fine, but it's a nuisance when we want to change the setup for them all. To avoid this duplication, a SetUp.xls file may be included in the folder structure. This file is automatically included before each test file in that folder, and in subfolders, before it is run.


Some groups of files may have corresponding tables at the end of each test, such as to shut down the system under test. In that case, a TearDown.xls may also be included in the folder structure. This file is automatically included after each test file before it is run.


Sometimes, only some of the tests within a test suite need to be run. Details are provided for programmers in Chapter 26 on how to manage the selection of the tests to be run.









    No comments: