web|xml| programs test XML WEB services and applications
Note:Some features may not be available in the publicly published Visual Studio.NET Beta 2.
As loosely coupled computing and XML WEB services continue to grow, organizations increasingly need tools to deliver successful solutions that meet the diverse needs of global users. Visual Studio.NET not only provides industry-leading tools for building XML WEB services and applications, but also includes some of the important features that can be used to test scalability, performance, and functional integrity of these applications.
Application-centric testing (ACT) is a new feature integrated with Visual Studio.NET that enables developers to collect performance metrics and perform functional testing of XML WEB services and applications in the Visual Studio.NET development environment.
ACT provides advanced scripting capabilities that enable developers to simulate multiple concurrent page requests to an XML Web service or application, and to analyze related performance accordingly. This can help developers design faster, more stable XML Web services and applications.
This article discusses the major test types and their properties that you can create. These include the following topics:
- Direct Input test Scenario
- Use a browser to easily record test scenarios
- Extending test scenarios through scripting
- Configure and save test scenarios for future reuse or regression
Then, we'll focus on how to build the application load, capture the results in the log file, use customizable reports and views to analyze performance, and automate the test process by running tests.
Creating Tests
ACT provides two types of tests: static and dynamic. Static tests use a grid interface similar to Microsoft Excel and do not need to be programmatically created. These tests can be generated using the main ACT user interface. Dynamic testing, which uses an object model specifically designed to create stress tests, can be edited directly in the Visual Studio.NET integrated Development Environment (IDE). You can use Microsoft Visual Basic
®Scripting Edition (VBScript), Microsoft JScript
®Or Perl to create these tests.
Developers can create each type of test in a variety of ways. All methods are described below.
Browser Record Test
The browser record test creation method can be invoked from the main ACT user interface. After you create a browser record test, ACT captures all HTTP requests sent by the browser when you browse the WEB application. It captures all the inline images, which in other cases will be automatically requested by the browser, so it will help create accurate tests. You can choose to create a static or dynamic browser record test.
To create a test using this method, follow these steps:
- Click the New Test Wizard button on the toolbar.
- Select Record New test, click Next, and then select the test type from the wizard options.
- Click the Start Record button. The browser opens as a blank page.
- Navigate to your page or application as if the customer had visited your site.
- When you are done, stop logging the program, and then type a name for the newly created test.
Figure 1: Creating a browser record test
If you choose dynamic testing, you can edit and run the test using the Visual Studio.NET IDE, which makes it easy to encode your application and get information about functionality and performance in the same environment.
Import Web server log files
If you have a WEB server log (for example, if the log was created from a live production site), you can import it into the tool to create a test that accurately simulates real Web traffic. Web server log files can be imported through the main ACT user interface.
To import a log, follow these steps:
- Click the New Test Wizard button on the toolbar.
- Select Import, and then select Web Server Log.
- Specify the name and location of the log file to import, and then choose another import option.
- Provide the name of the new test, and then click Finish. The contents of the log are added to the new static test.
The WEB server log file must follow the following format:
- Microsoft Internet Information Services (IIS) log file format
- NCSA Common Log file format
- The format of the expanded log file for the Consortium
Figure 2: Importing a WEB server log file
To change a static test to a dynamic test
If you create a static test using one of these test creation methods, you can easily convert it to a dynamic test. Because dynamic testing allows scripting to analyze the response of a WEB server and perform conditional operations, it is more flexible. To convert a static test, right-click the desired static test and select Convert to Dynamic test. The transformation will be done in the main ACT user interface. After you complete the test transformation, you can edit and run the converted test in the Visual Studio.NET IDE.
Figure 3: Dynamic Testing
Configuring Tests
You can use test properties to set the number of concurrent requests generated and the uniqueness of each request. If you are using the main ACT user interface, right-click the test to see the properties associated with it. If you are using the Visual Studio.NET IDE, you can view the properties of the selected test in the project Properties view.
Each test allows the developer to specify the exact number of concurrent connections to the browser, or to specify the number of target requests per second that the tool automatically archives. The test will run a certain number of iterations or length of time.
The Test property page also controls whether the tool automatically creates a unique user or loops through the user name and password in a predefined list. This option is especially useful for sites that need to identify specific user names.
Run Tests
After you create and configure the test, you can perform the test by right-clicking the test name and choosing Run test. When the test runs, the tool displays Run-time data, provides the visual state of the request rate, and feeds back any errors that may occur during stress testing.
Figure 4: Viewing test results at run time
Analysis Results
Understanding performance Test results is important for successfully tuning an XML Web service or application. ACT provides a set of content-rich standard reports that are built with XML. Developers can easily customize these reports to describe information related to the application.
When you run tests in the Visual Studio.NET IDE, you can get the following information by default:
- Number of requests per second
- Time to receive the first byte (response time indicator)
- Time to receive last byte (Response time Metric)
- TCP and HTTP errors
- Number of Successful requests
The main ACT interface contains detailed information related to the test results. The results section contains several predefined charts that show the most commonly used performance metrics.
Developers can also use custom chart options to create a chart that contains the metrics for several different tests and the number of times they have been run in all tests. In addition, the results will contain tabular data showing the related performance of all pages that have been tested, as well as general test information and settings.
Figure 5: Using the custom chart option
Automate the test
ACT enables developers to automate the testing process by controlling the Application object model of the ACT test tool. The application model can be accessed through Microsoft Visual Basic for Applications (VBA), other COM-aware scripting languages, and any Visual Studio.NET language. This allows developers to create automated and powerful test sets, and greatly simplifies the process of running regression tests and other common tasks.
Summary
Visual Studio.NET provides industry-leading tools for building XML WEB services and applications. The key to enabling customers to successfully build and deploy these applications is that it ensures that their performance meets the diverse needs of global users. In addition, customers need to verify the correctness of their XML WEB services and application functionality to meet their business needs. To address these issues, the Visual studiuo.net ACT includes a variety of features for stress, load, and functional testing of all XML WEB services and applications that are integrated into the IDE. With ACT, organizations can integrate tests into a project at a lower cost as early as possible, and perform tests as part of their entire application lifetime. Test groups and action groups can easily reuse tests developed by developers and automate the testing process to maximize productivity and coverage. All this makes the application development process easier to predict and support.