Testing


You should plan to stress test and load-test your ASP.NET applications. There are full-featured , sometimes pricey third-party products that you can purchase to assist you with this task. Then, there is Microsoft s Application Center Test (ACT) product, which comes bundled with the Enterprise edition of VS .NET. In this appendix, you will learn how to use the ACT feature. Microsoft appropriately refers to ACT as an "application life cycle development tool."

As you learned in Chapter 13, the .NET toolset includes the ACT feature. You will recall that there are two ways to access this feature. You can access ACT from within VS .NET as a project template through the Add New Project window. You can also access the ACT product by clicking the Start button and selecting Pro grams Microsoft Visual Studio .NET Visual Studio .NET Enterprise Features Microsoft Application Center Test.

Either approach exposes an option that allows you to record a "test script" using your Web browser. The script can then be played back to simulate actual users using the ASP.NET application. Both approaches offer the ability to simulate multiple concurrent connections. You will start by accessing ACT from within the VS .NET IDE. Later, you will walk through the alternative approach (accessing ACT from outside the VS .NET IDE).

Using ACT Inside VS .NET

For demonstration purposes, use the two sample ASP.NET applications originally created in Chapter 13. Both sample applications (WebApplicationSampleVB and WebApplicationSampleCobol) are simple "Hello, World" applications. Start by opening up WebApplicationSampleVB.sln in the VS .NET IDE. Next, perform the following steps to complete the process of setting up an ACT project in an existing solution:

  1. With WebApplicationSampleVB.sln open in the VS .NET IDE, navigate to the VS .NET IDE Standard toolbar. Select File Add Project New Project. As shown in Figure A-12, the Application Center Test Projects folder is located underneath the Other Projects folder in the Add New Project window. Click OK after you select the one available template.

    click to expand
    Figure A-12: The Add New Project dialog box showing the ACT Project template

  2. In the VS .NET IDE Solution Explorer window, locate the newly added ACT project. Right-click the ACT project in the Solution Explorer window. Select Add Add New Item from the pop-up context window.

  3. As shown in Figure A-13, the Add New Item dialog box offers three default script-based templates. Select the Browser Recorded Test (.vbs) template. Click Open.

    click to expand
    Figure A-13: The Add New Item dialog box showing the three default templates

  4. A Browser Record dialog box should appear (see Figure A-14). Click Start.

    click to expand
    Figure A-14: Ready to start recording with the Browser Record dialog box

  5. A Browser window should open. Enter the targeted Web site URL in the address bar. For demonstration purposes, I used http://localhost/WebApplicationSampleVB/WebForm1.aspx . This is the URL for the sample application. I then clicked the one Web Form button to generate the expected "Hello, World" text box display.

  6. End the browser recording. As shown in Figure A-15, you should click the Stop button on the Browser Record dialog box to end browser recording.

    click to expand
    Figure A-15: Preparing to end the browser recording

  7. Observe the creation of a VBScript (.vbs) file in your VS .NET Solution Explorer window. Please take a moment to view the contents of the .vbs file. You will notice that this VBScript is actually the recorded test script.

  8. Start the test. Right-click the .vbs file and select Start Test (see Figure A-16). Observe the VS .NET Output window while the ACT test is running.

    click to expand
    Figure A-16: Starting the ACT test from within VS .NET

  9. After you let the ACT test run for a little while, stop the ACT test by right-clicking the .vbs file and selecting Stop Test (see Figure A-17).

    click to expand
    Figure A-17: Stopping the ACT test from within VS .NET

  10. As shown in the Figure A-18, the VS .NET Output window contains the test results.

    click to expand
    Figure A-18: The VS .NET Output window showing the ACT test results for the sample application WebApplicationSampleVB

    Note  

    Once I completed testing the WebApplicationSampleVB application with ACT, I opened the WebApplicationSampleCobol sample application solution in VS .NET. Following the same steps detailed in this section for the VB .NET sample application, I was able to load-test the COBOL .NET sample application.

Now, that was not that bad, right? I suggest that you refer to the references provided at the end of this chapter in the "To Learn More" section to find infor mation that will guide you toward an accurate interpretation of the test results. Additionally, you might consider using the Performance Monitor (click the Start button and select Programs Administrative Tools Performance) while your ACT test script is running. As shown in Figure A-19, several performance counters relevant to the performance of your application may be of interest to you.

click to expand
Figure A-19: The Performance Monitor

In practice, I found that using ACT in VS .NET offered one basic advantage: It promotes the storage of ACT projects inside the related .NET solution. Otherwise, using ACT from within VS .NET is somewhat limited. As your testing needs grow, you will want to leverage the more advanced features of ACT. To do this, you will need to access the stand-alone ACT product from outside VS .NET.

Note  

Be sure to close the WebApplicationSampleVB VS .NET IDE solution that contains the new ACT project. The ACT product does not allow multiple user interfaces to concurrently open the same ACT project.

Using ACT Outside VS .NET

Start by launching the ACT stand-alone product (click the Start button and select Programs Microsoft Visual Studio .NET Visual Studio .NET Enterprise Fea tures Microsoft Application Center Test). Once ACT is launched, you should see a window similar to the one shown in Figure A-20.

click to expand
Figure A-20: The ACT stand-alone product

From the ACT menu or toolbar, you can either create a new ACT project or open an existing one. For demonstration purposes, I opened the existing ACT project created earlier for the WebApplicationSampleVB sample application (see Figure A-21).

click to expand
Figure A-21: Viewing an existing ACT project and existing ACT test script in the ACT stand-alone product

Take a moment to explore the ACT menu and toolbar. You will quickly discover the full support exposed to create new ACT projects and new ACT test scripts. There is support to view your ACT results. You will notice that even the test results that were created while running from within VS .NET are exposed.

Choose your existing ACT test script and run it. Right-click the ACT test script and select Start Test (see Figure A-22) from the pop-up context menu to run the existing test script.

click to expand
Figure A-22: Preparing to run the existing ACT test script for the WebApplicationSampleVB sample application

Once you initiate the ACT test script to run, you will notice that an ACT Test Status window opens. Using the buttons on the ACT Test Status window, you can choose to Hide/Show Details or Stop the test. There are two useful tabs: Graph and Status. As shown in Figure A-23, the Graph tab offers a similar display to that of the Performance Monitor.

click to expand
Figure A-23: Viewing the Graph tab on the ACT Test Status window

After you let the ACT test script run for a while, stop the test and view the results. You will notice that the various reports that make up the results for the ACT stand-alone product are more informative than the reports shown within VS .NET. Obviously, this is one significant reason for choosing to use ACT from outside VS .NET.

As you explore further, you may discover pros and cons to the use of ACT, either within VS .NET or outside VS .NET (as a stand-alone product). Either way, I m sure that you ll find the ACT tool to be a welcome addition to the .NET suite of tools.

Note  

ACT is the newest version of a pre-.NET load-testing tool. A previous version of this tool was known as Homer. More recently, a version was named Web Application Stress (WAS) testing tool.




COBOL and Visual Basic on .NET
COBOL and Visual Basic on .NET: A Guide for the Reformed Mainframe Programmer
ISBN: 1590590481
EAN: 2147483647
Year: 2003
Pages: 204

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net