Test scripts simulate user actions. Although many test tools let you create a test script by recording it, many also let you use log files saved by Internet Information Services (IIS). (These IIS logs are a collection of user events.) This method may be more accurate because it contains real-world commands from actual users, but be sure your test tool can import IIS logs before you depend on this method. Note that if your site has not yet gone live, you may not have access to such user logs.
You can also create a test script by typing script commands in the language understood by the test tool (some use VBScript, some use JavaScript).
You can configure the tests to create the rise in workload you want and spread this increase over an amount of time you specify.
PT application testers used five different scripts to simulate how they expected the application to be used normally. Each script performs specific actions on pages in the PT application.
All five scripts were created from recordings of keystrokes. PT application testers had the LitWare developers instruct them how to run the application and with what frequency to perform individual actions. This frequency was reflected in the weighting of script execution. For example, the weighting of the Add1Change5 script was 50 percent, which means that for every active 100 virtual users, 50 of them are running this script. Weighting percentages are given in the following list of scripts. (This weighting was identical for tests that ran on both operating systems: Windows NT 4.0 and Windows 2000.)
The five scripts used to test the PT application perform these actions:
Most of the transactions in the test scripts represent the retrieval of PT application pages from the Web server (and often, data from SQL Server) although some transactions displayed pages from the browser cache.
The scripts used in these stress tests contain a series of commands, including the command Sleep, as shown in the following code fragment:
//Select User Information to display the Person form
Sleep(10000)
WebPage.FormData["fileName"] = "person"
WebPage.Get("http://<Your ServerName>/tat/en-us/gate.asp")
The Sleep command takes one parameter that specifies an amount of time to pause (in milliseconds) before executing the next command. The recording of scripts automatically generated Sleep commands to account for delays of various types. For example:
Note As you might expect, tests that contained shorer Sleep commands or none at all gave much higher TPS rates. The BDG chose not to include them in this analysis because such tests do not reflect real-world conditions. The technique of reducing or eliminating Sleep commands may prove useful when the search for bottlenecks begins.