You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

AuthoringTests.txt 6.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. ==========================================================================
  2. Visual Studio Team System: Overview of Authoring and Running Tests
  3. ==========================================================================
  4. This overview describes the features for authoring and running tests in
  5. Visual Studio Team System and Visual Studio Team Edition for Software Testers.
  6. Opening Tests
  7. -------------
  8. To open a test, open a test project or a test metadata file (a file with
  9. extension .vsmdi) that contains the definition of the test. You can find
  10. test projects and metadata files in Solution Explorer.
  11. Viewing Tests
  12. -------------
  13. To see which tests are available to you, open the Test View window. Or,
  14. if you have installed Team Edition for Software Testers, you can also open
  15. the Test List Editor window to view tests.
  16. To open the Test View window, click the Test menu, point to Windows, and
  17. then click Test View. To open the Test List Editor window (if you have
  18. installed Team Edition for Software Testers), click Test, point to Windows,
  19. and then click Test List Editor.
  20. Running Tests
  21. -------------
  22. You can run tests from the Test View window and the Test List Editor window.
  23. See Viewing Tests to learn how to open these windows. To run one or more
  24. tests displayed in the Test View window, first select the tests in that
  25. window; to select multiple tests, hold either the Shift or CTRL key while
  26. clicking tests. Then click the Run Tests button in the Test View window
  27. toolbar.
  28. If you have installed Visual Studio Team Edition for Software Testers, you can
  29. also use the Test List Editor window to run tests. To run tests in Test List Editor,
  30. select the check box next to each test that you want to run. Then click the
  31. Run Tests button in the Test List Editor window toolbar.
  32. Viewing Test Results
  33. --------------------
  34. When you run a test or a series of tests, the results of the test run will be
  35. shown in the Test Results window. Each individual test in the run is shown on
  36. a separate line so that you can see its status. The window contains an
  37. embedded status bar in the top half of the window that provides you with
  38. summary details of the complete test run.
  39. To see more detailed results for a particular test result, double-click it in
  40. the Test Results window. This opens a window that provides more information
  41. about the particular test result, such as any specific error messages returned
  42. by the test.
  43. Changing the way that tests are run
  44. -----------------------------------
  45. Each time you run one or more tests, a collection of settings is used to
  46. determine how those tests are run. These settings are contained in a “test
  47. run configuration” file.
  48. Here is a partial list of the changes you can make with a test run
  49. configuration file:
  50. - Change the naming scheme for each test run.
  51. - Change the test controller that the tests are run on so that you can run
  52. tests remotely.
  53. - Gather code coverage data for the code being tested so that you can see
  54. which lines of code are covered by your tests.
  55. - Enable and disable test deployment.
  56. - Specify additional files to deploy before tests are run.
  57. - Select a different host, ASP.NET, for running ASP.NET unit tests.
  58. - Select a different host, the smart device test host, for running smart device unit tests.
  59. - Set various properties for the test agents that run your tests.
  60. - Run custom scripts at the start and end of each test run so that you can
  61. set up the test environment exactly as required each time tests are run.
  62. - Set time limits for tests and test runs.
  63. - Set the browser mix and the number of times to repeat Web tests in the
  64. test run.
  65. By default, a test run configuration file is created whenever you create a
  66. new test project. You make changes to this file by double-clicking it in
  67. Solution Explorer and then changing its settings. (Test run configuration
  68. files have the extension .testrunconfig.)
  69. A solution can contain multiple test run configuration files. Only one of
  70. those files, known as the “Active” test run configuration file, is used to
  71. determine the settings that are currently used for test runs. You select
  72. the active test run configuration by clicking Select Active Test Run
  73. Configuration on the Test menu.
  74. -------------------------------------------------------------------------------
  75. Test Types
  76. ----------
  77. Using Visual Studio Team Edition for Software Testers, you can create a number
  78. of different test types:
  79. Unit test: Use a unit test to create a programmatic test in C++, Visual C# or
  80. Visual Basic that exercises source code. A unit test calls the methods of a
  81. class, passing suitable parameters, and verifies that the returned value is
  82. what you expect.
  83. There are three specialized variants of unit tests:
  84. - Data-driven unit tests are created when you configure a unit test to be
  85. called repeatedly for each row of a data source. The data from each row
  86. is used by the unit test as input data.
  87. - ASP.NET unit tests are unit tests that exercise code in an ASP.NET Web
  88. application.
  89. - Smart device unit tests are unit tests that are deployed to a smart device
  90. or emulator and then executed by the smart device test host.
  91. Web Test: Web tests consist of an ordered series of HTTP requests that you
  92. record in a browser session using Microsoft Internet Explorer. You can have
  93. the test report specific details about the pages or sites it requests, such
  94. as whether a particular page contains a specified string.
  95. Load Test: You use a load test to encapsulate non-manual tests, such as
  96. unit, Web, and generic tests, and then run them simultaneously by using
  97. virtual users. Running these tests under load generates test results,
  98. including performance and other counters, in tables and in graphs.
  99. Generic test: A generic test is an existing program wrapped to function as a
  100. test in Visual Studio. The following are examples of tests or programs that
  101. you can turn into generic tests:
  102. - An existing test that uses process exit codes to communicate whether the
  103. test passed or failed. 0 indicates passing and any other value indicates
  104. a failure.
  105. - A general program to obtain specific functionality during a test scenario.
  106. - A test or program that uses a special XML file (called a “summary results
  107. file”), to communicate detailed results.
  108. Manual test: The manual test type is used when the test tasks are to be
  109. completed by a test engineer as opposed to an automated script.
  110. Ordered test: Use an ordered test to execute a set of tests in an order you
  111. specify.
  112. -------------------------------------------------------------------------------