Lab: Testing and Debugging

Lab: Testing and Debugging

In this lab, you ll apply the lessons from this chapter to review a real-world testing plan, write unit tests for a sample application, load test a deployed application, and step through a Web application running on a remote server using the Visual Studio .NET debugging tools.

Estimated lesson time: 30 minutes

Exercise 1: Review a Test Plan

Testing strategies and terminology vary from company to company. In this exercise, you ll use a test plan from your own company to identify the concepts discussed in Lesson 1. If you don t work for a company that uses test plan documents, search the Internet using the phrase software test plan, and choose a test plan from the search results.

Using an actual test plan, highlight any mention of the following items:

  • Unit testing

  • Integration testing

  • Ad hoc testing

See whether you can find answers to the questions posed in Lesson 1:

  • How are tests written?

  • Who is responsible for the testing?

  • When are the tests performed?

  • Where are the tests and test results stored?

  • What is being tested?

Based on this information, does the plan give you a clear idea of how testing will verify that the product requirements are met?

Exercise 2: Write Unit Tests

In this exercise, you ll use VBScript or JScript to create unit tests for the Circle and Sphere classes that were derived from the Shapes abstract class in Chapter 3, Working with Web Objects. The unit tests should verify that the following conditions are met:

  • Circle and Sphere classes can be created.

  • Classes can be passed to procedures accepting the IFigure interface.

  • All properties work with minimum and maximum values.

  • All methods return expected results for two or more test cases.

To create unit tests in VBScript or JScript

  1. Register the assembly for use with COM by running the RegAsm.exe utility from the Visual Studio .NET command prompt.

  2. Copy the Windows Scripting Host (CScript.exe) to the folder containing the assembly to test.

  3. Using Visual Studio .NET, Notepad, or some other editor, create the tests in VBScript or JScript.

  4. Run the scripts from the Visual Studio .NET command prompt using the copy of CScript.exe in the assembly folder.

When you have finished, compare your results to those found in the sample files on the companion CD.

Exercise 3: Create a Load Test

If you have Visual Studio .NET Enterprise Architect, use ACT to create a load test for a Web application that has been deployed to a test server. Choose any deployed Web application that you want, but follow these test parameters:

  1. Record at least five different requests to the server.

  2. Add performance counters for the server s percentage of processor time, memory pages per second, and average disk read queue length.

  3. Log the results to a Log folder within the Web application s folder structure.

  4. Set the test properties to run for 30 seconds using four simultaneous connections.

  5. Run the test.

  6. View the performance counters for the server in chart form within ACT.

When you have finished, compare your results to the ACT sample recorded for the FlashCards sample application on the companion CD.

Exercise 4: Step Through a Remote Process

In this exercise, you ll use Visual Studio .NET to pause and step through a Web application running on a remote server. To complete this exercise, you must belong to the Debugger Users group on the server and the server must have the Visual Studio .NET remote components installed.

To step through a Web application running on a remote server

  1. From your workstation, access the Web application using Microsoft Internet Explorer. This ensures that the Web application is running on the server when you try to attach to its process.

  2. From the Visual Studio .NET Tools menu, choose Debug Processes. Select the server where the application is running, select the application s process (named aspnet_wp.exe), and then click Attach.

  3. Set a breakpoint on the Page_Load function.

  4. Switch to Internet Explorer, and click Refresh.

  5. Switch back to Visual Studio .NET. The remote application should be paused at Page_Load.

  6. Set breakpoints at other locations in code.

  7. In Visual Studio .NET, click Continue to run to the next breakpoint.



MCAD(s)MCSD Self-Paced Training Kit(c) Developing Web Applications With Microsoft Visual Basic. Net and Microsoft V[.  .. ]0-315
MCAD(s)MCSD Self-Paced Training Kit(c) Developing Web Applications With Microsoft Visual Basic. Net and Microsoft V[. .. ]0-315
ISBN: N/A
EAN: N/A
Year: 2003
Pages: 118

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