Datapools provide variable data to your tests during execution.
Performance tests are based on user emulation. During a session with the application-under-test, the tester actually uses a feature that real customers will use, and from the recorded session a test is generated containing the exact data that the tester entered. For example, to create a performance test for a dialog in a web-based shopping application that prompts a shopper for an account number, the tester actually engages the dialog by selecting an item that is offered for sale, clicking a "pay now" button, and entering an account number. During playback of the test, in which the tester might request that hundreds of instances of the transaction be run simultaneously, it is desirable that different account numbers (perhaps a combination of valid and invalid numbers) are used for each of the instances. To supply variable data for tests to use during playback, the tester creates datapools.
Datapools contain three structural elements:
Equivalence class. A datapool subset containing a range of data that, when submitted to a test, produces the equivalent pass/fail result. A datapool must contain one equivalence class.
Equivalence classes are important for low-level tests that software developers use to test their source code. Performance tests do not use equivalence classes. For the purposes of performance testing, you can think of an equivalence class as just a named row index, displayed in the leftmost datapool column. You can add any number of equivalence classes, but for a datapool that will be used only for performance testing, there is no need to add more than one.
Record. A row of data. Rows are indexed by equivalence class starting with 0.
Variable. A named data column. Data resides in column cells and is typically typed based on what is expected by the application-under-test.
As shown in the following figure, the datapool editor is a grid similar
to a spreadsheet. Right-clicking on the grid opens the popup menu that you
use to add or maintain the datapool structural elements described above. You
add data by typing in a cell.
When you create a datapool, you have the option of initializing the new datapool with data contained in an existing comma-separated-value (CSV) file that you created with a spreadsheet editor or with some external or custom tool. For datapools containing large amounts of data, this approach is recommended. The datapool editor is suitable for entering small amounts of data and modifying individual records but provides no means of generating large amounts of typed data.
Parent topic: Providing tests with variable data
Next topic: Creating a datapool