How to: Create a Test Plan
A test plan lets you specify what you want to test and how to run those tests. A test plan can be applied to a specific iteration of your project. You can have just one default test suite for your test cases, or you can create a test suite hierarchy.
You can also select the default configurations to use to run the tests in your test plan. The test configuration informs the tester of the set up that is required for these tests. You can have one or multiple default configurations. A test result is recorded every time that you run the test with a specific configuration. A test plan enables you to measure your testing progress, based on these test results for the test and configuration pairings, as shown in the following illustration.
Poznámka
You can also assign default configurations at the test suite level if specific test suites need different configurations from the overall plan.
If you require specific test configurations for your test plan, it is easier to create your test configurations first. If you do this, you can select the default configurations for your plan and when you add test cases, the pairings between the test case, and each default configuration are automatically set up. You can update these pairings later if you want. For more information about how to create test configurations, see How to: Create Test Configurations.
Poznámka
You do not have to define configurations. You can just use the default configuration that is provided.
You can also define default test settings for your test plan. These test settings determine how your tests will be run. Test settings enable you to do many tasks automatically such as collect information about the actions that are performed when you are testing, record these actions, make a video recording, and collect system information or code coverage data. You can also use test settings to run your automated tests remotely, using specific environments.
You can override the default test settings in your plan when you select tests to run. For more information about test settings and environments, see Setting Up Machines and Collecting Diagnostic Information Using Test Settings and Setting Up Test Machines to Run Tests or Collect Data.
Poznámka
You do not have to define test settings for manual tests. You can use the default setting, which is Default, and your manual tests will just run on a local computer.
After creating a test plan, you might want to review the test plan to check that the test cases cover the key functionality of the application. This may be easier to accomplish by using a Microsoft Word document that you have created. You can use the Test Scribe power tool to create a word document from your test plan. Using this word document anyone can review the test cases in the test plan without having to open each test case.
Use the following procedures to create a test plan:
Create a test plan and set the properties for the plan that include adding default configurations and default test settings
Create test suites and add test cases
Update configurations for specific test cases
Assign tests to testers
Order test cases in a test suite
Add external links to your test plan
Create a test plan
Some of the properties that you can set for a test plan are shown in the following illustration:
To create a test plan
Open Microsoft Test Manager.
Poznámka
To display the Microsoft Test Manager window, click Start, and then click All Programs. Point to Microsoft Visual Studio 2010 and then click Microsoft Test Manager 2010.
To create a test plan, click the down-arrow on the center group switcher and then click Testing Center.
Click the current plan name displayed in the upper right hand corner.
The Testing Center dialog box is displayed.
Poznámka
You can also manage test plans, including creating test plans, from the Test Case Manager in the Organize view.
To create a plan, click Add.
The Add test plan dialog box is displayed.
Type the name for your plan in Enter the plan name, and then click Add.
Your plan is now added to the list and highlighted.
To select the plan you added to use, click Select plan.
The Contents view for your test plan is now displayed.
To change to the properties view for your test plan, click Properties.
(Optional) In Description type the description of the test plan.
(Optional) To change the owner, click Owner and then select the new owner.
Click State and select from the list of states, based on the following table:
State
When to use it
Active
When you are planning or running the tests in the test plan.
Inactive
When you have completed the test plan.
Důležité
To view the test plan or run tests, you must set the status of a test plan to Active. If a test plan is in an inactive state, you cannot view the test plan and edit it in the Plan view. You can only access it from the Test Plan Manager.
(Optional) In Start date type the day that you want the test plan to begin and in End date type the date that the test plan will be completed.
Poznámka
These dates do not affect the state of the test plan.
To select the area of your team project that this test plan covers, click Area.
To select the iteration for running the tests in your test plan, click Iteration.
Poznámka
The iterations are set up in your team project by the Team Foundation Server administrator.
(Optional) To select the test settings to use for any manual tests in this test plan, click Test settings under Manual runs.
Poznámka
You can select from test settings that have already been created, or you can select New from the list to start the test settings wizard to create new test settings. For more information about test settings, see Setting Up Machines and Collecting Diagnostic Information Using Test Settings and How to: Create Test Settings for a Test Plan.
(Optional) To view an existing test settings to confirm it is correct, or to update a test setting, select the test settings in the list and then click Open.
(Optional) To select the test settings to use for any automated tests in this test plan, click Test settings under Automated runs.
Poznámka
You might want to use different test settings to specify how to run your automated tests because you may choose to run them on a different set up than your manual tests. For more information about how to run automated tests, see Setting Up Test Machines to Run Tests or Collect Data and Create Test Settings for Automated Tests as Part of a Test Plan.
(Optional) To select the default configurations to use for any test suites that you add into your test plan, click In this plan under Configurations.
The dialog box is displayed. It shows all the configurations for your team project and the current default configurations for your test plan.
Poznámka
By default, a configuration called Windows 7 and IE 8 has been created and is selected for use with your test plan.
(Optional) Select the default configurations that you want to add and any that you want to remove.
Poznámka
Changing the default configurations only affects new test cases that are added to your test plan. For more information about how to change the pairings of tests and configurations that are already in your test plan, see the procedure about updating configurations for specific test cases.
(Optional) To add a new configuration, click Manage.
The Test Configuration Manager activity is displayed. For more information about how to create configurations using the test configuration manager, see How to: Create Test Configurations.
(Optional) To save your changes to the default configurations, click Apply.
(Optional) To select the build definition and the build quality that you will use to test, click the drop-down arrow for Filter for builds. These builds refer to any team build definitions that are used to build your application under test.
The Filter completed builds dialog box is displayed.
Poznámka
If you are not using Team Foundation Build to build your application, then you do not have to set Build filter or Build in use. For more information about using Team Foundation Build, see Creating and Working with Build Definitions.
(Optional) To select the build definition that represents the builds you will use for your testing in this test plan, click Build definition.
(Optional) Each build can be given a specific value to reflect the quality of the build. To select the quality of the build required for your testing in this test plan, click Build quality.
Poznámka
For more information about build definitions and build quality, see Creating and Working with Build Definitions.
(Optional) To save your changes, click Set build filter.
(Optional) To select the build that you are currently using for testing this test plan, you have to first click Save to save the changes for the build filter and then click Modify.
The Assign Build view is displayed. You can compare your current build with a build you plan to use for testing. The associated items list shows the changes to work items between the builds to help you decide. You can then select a new build to take and use for testing with this plan. For more information about how to select a build, see Determining Which Builds Have Bug Fixes, New Features, or Requirements.
(Optional) To close the Assign Build activity and return to the test plan properties, click the Close icon.
To save these changes for this test plan, click Save in the toolbar.
Create test suites and add test cases
You can create different types of test suites in your test plan, or you can just use the default test suite provided and add your test cases into that one. How to create these different types of test suite is shown in the following illustration:
This procedure describes creating a test suite and adding existing or new test cases to it. For more information about the different types of test suites and organizing them into a hierarchy, see Organizing Test Cases Using Test Suites.
To create test suites and add test cases
From the Testing Center, click Plan and then click Contents.
The Contents pane is displayed.
To create a new test suite, click New in the pane that shows the test suite root node.
Poznámka
The test suite hierarchy has a root node that has the same name as the test plan. You can add test cases or test suites to this test suite root node, but you cannot rename it.
Type the name for your new test suite.
The name will also be displayed in the test suite details pane.
Click State and select from the list of states, based on the following table:
State
When to use it
In Planning
If you are not yet ready to run the tests in this test suite.
In Progress
When you are ready to run the tests in this test suite.
Completed
When you have finished running the tests in this test suite and the quality level reached meets your goals.
Důležité
To run tests, you must set the status of a test suite to In Progress.
To change the default configurations for the test suite you created, if you want them to be different from the default settings for the plan, click the drop-down arrow following the list of configurations in the test suite details pane.
The dialog box is displayed that shows all the configurations for your team project and the current default configurations for your test plan.
You must first clear Use configurations from parent test suite, and then select the default configurations that you want to add and any that you want to remove.
Poznámka
Changing the default configurations only affects new test cases or test suites that are added to this test suite. For more information about how to change the pairings of tests and configurations that are already in your test plan, see Update configurations for specific test cases.
To add an existing test case to this test suite, click Add.
The Add test cases to suite dialog box is displayed. All available test cases are shown in the list of tests.
Poznámka
Tests that have already been added to the test suite are not shown in the list of tests.
(Optional) If there are several test cases listed, you can narrow your test case search by changing the query for test cases as shown in the following steps.
To add a new clause to your query, select Click here to add a clause.
Click each column in the query clause to fill in the clause. If a column has a list of accepted values, a drop-down arrow appears when the column is selected. Click the drop-down arrow to select a value from the list. The following columns are available:
Query Column
How to complete
And/Or
Select And if this clause and the previous clause must be true to match a result. Select Or if either this clause or the previous clause must be true to match a result.
Field
The list for this field contains all the searchable work item fields used in the current Team Foundation Server. Use as many clauses and fields as you want to get useful results. Press ALT+DOWN ARROW or type the field name that you want to select.
Operator
Examples of operator choices are = (equal), <> (not equal to), > (greater than), < (less than), >= (greater than or equal to), <= (less than or equal to), In, Was Ever, Was Never, and Contains.
Value
Specifies the value that you are looking for in the specified field. If there is a list of values to select from, click the drop-down arrow to select the one that you want. Team Foundation work item tracking includes some query variables to dynamically add values to your query. For more information, see Query Variables.
Repeat the previous two steps to add all the values for which you want to search.
To see the results of your query, click Run to run the query.
Select the tests that you want to add, and then click Add test cases.
The test cases that you selected are now displayed in the test suite details pane.
To create a test case and add it to this test suite, click New.
The New Test Case dialog box is displayed.
Enter the details for your new test case including the actions and expected results for each test step, and then click Save and Close.
The new test case is now displayed in the test suite details pane.
Poznámka
For more information about how to create new test cases, see How to: Create a Manual Test Case.
Repeat the previous two steps to add more test cases.
Poznámka
All the existing test cases that you add, or new test cases that you create, are paired with each default configuration to define what tests must be run on which configurations for the test plan. To see these pairings, select the test suite and then click Configurations.
The changes you have made to the test plan are automatically saved.
Update Configurations for Specific Test Cases
You can update the default assignments of test configurations to test cases in each suite. You can remove pairings that you do not want to test and add other combinations. This gives you the flexibility to specify in your plan only those pairings of configurations and test cases that you really want to test as shown in the following illustration.
To update configurations for specific test cases
From the Testing Center, click Plan and then click Contents.
The Contents pane is displayed.
To change the default assignments of test configurations for a test case, select the test suite that contains the test case.
If you want to be able to change the test configurations for any of the test cases in a test suite, right-click the test suite and select Select test configurations for all tests.
- or -
If you want to change the test configurations for specific test cases in the test suite, select the specific tests in the test suite details pane, and click Configurations in the Test Suite Details pane toolbar.
The Select Test Configurations dialog box is displayed.
To view all the test configurations in your team project, click All configurations.
Any configurations in your team project that are not assigned to this test plan are displayed.
To create or remove an existing pairing of any test case in this test suite with a specific configuration, click in the appropriate cell.
A check mark is displayed or removed from the cell, based on the previous state of the cell.
To view only the test configurations assigned to this test suite, click Assigned configurations.
(Optional) To reset the test case and configuration pairings, click Reset defaults.
(Optional) If you have many changes to make, select Enable range selection and fill mode to mark a range. To start marking the range, click the first item, and then hold down SHIFT and then click the last item.
All the items in the range are filled with the same value as the first item.
To save your changes, click Apply changes.
Assign Tests to Testers
By default, tests are assigned to be run by the user that is assigned to the test case. Use the following procedure and illustration to assign each pairing of a test with a configuration if you want a tester who is not assigned to the test case to run this particular pairing. This does not change the user who is assigned to the test case.
To assign tests to testers
From the Testing Center, click Plan and then click Contents.
The Contents page is displayed.
To change the default assignments of testers, select the test suite that contains the test cases that you want to reassign.
If you want to be able to reassign any of the test cases in a test suite, right-click the test suite and select Assign testers for all tests.
- or -
If you want to reassign specific test cases in the test suite, select the specific tests in the test suite details pane, and click Assign in the Test Suite Details pane toolbar.
The Assign Testers dialog box is displayed. It shows all the pairings of test cases and configurations for the test cases that you selected.
Click Tester to select a different tester to run the specific pairing of a test case with a configuration.
Poznámka
You can select multiple pairings of test cases and configurations and change the assignment for all by changing Tester for any one of the selected rows.
(Optional) To group the test cases by a specific column, drag the column title to Drag a column header here to group by that column. If you drag the column title for configuration, you can now select all the test cases for a specific configuration. Press Shift in the first row of the group and press Shift in the last row, and then click Tester in one of the rows to assign them to the same tester.
To save your changes, click Save assignments.
Any changes to the assignments are displayed in Testers.
Poznámka
If different testers are assigned to different configurations for the same test, Multiple is displayed in Testers.
Order Test Cases in a Test Suite
You might want to list and run your test cases in a specific order. For example, you might want to run the simplest tests first, because if these tests failed then the subsequent tests in your test suite would be blocked. You can change the order of your test cases in your test suite, unless your test suite is a query-based test suite or has been created by adding a requirement or user story to your test plan. When you run the tests from the test suite, the tests will be listed in Test Runner in the order shown in the order column in your test suite.
To order test cases in a test suite
From the Testing Center, click Plan and then click Contents.
The Contents pane is displayed.
To change the order of test cases in a test suite, select the test suite in the test suite hierarchy pane, and then click Order.
The Order Test Cases dialog box is displayed. All test cases in the test suite are shown in the list of tests.
Type the new value for the position of a test in Order. For example, to move a test to the top you can type 1 in Order, or to move a test to the end of the list type the total number of test cases in the suite in Order.
This order will now be used when you run these tests.
Poznámka
To move a test case A (order 2) under an existing test case B (order 4), type 5 in Order. Test case A will now appear under test case B. To move a test case C (order 5) above an existing test case D (order 3), type 3 in Order. Test case C will now appear above test case D.
Add External Links to Your Test Plan
You might want to add external links to a Web site that has more information about the application that you are testing. Or you might want to link to a document about the requirements that you need to test for the current sprint from your test plan. This allows you to associate any relevant information with your test plan so it can easily be located by a tester.
To add external links to your test plan
From the Testing Center, click Plan and then click Properties.
The Properties pane is displayed.
To add an external link, click the down arrow next to Links, and then click Add.
The Add External Link dialog box is displayed.
Type the value for the URL in External URL. This could be a file or a Web site.
Type a comment to identify the URL in Comment.
Click Add link.
The URL is now displayed in the list of links.
(Optional) To open the link to verify that the path is correct, select the link and click Open.
You can add and delete links as required for your test plan.
See Also
Concepts
Running Manual Tests Using Test Runner