version of your application. Once you have a test plan you will see the Contents View, which is
Test and lab Manager .
1107
shown in Figure 56-14. From here you can create new tests, add existing tests, and assign testers and
configurations to your tests.
Each plan has a state, which can be In Planning, In Progress, or Complete. This
information is stored in the Team Foundation Server and can be surfaced in
reports. When a plan is in progress, a percentage of how many of the planned
test cases are complete is also available.
If you open an existing test case or create a new one you will see the Test Case window shown in
Figure 56-15. Each test case is made up of a number of actions, which are shown toward the bottom
of the window. Each action comes with a description of what the tester should do, along with a
description of how to verify that the action has completed successfully.
fiGure 56-15
Actions can have parameters like the one in the fourth step of Figure 56-16. Each parameter can
have multiple values defined, and there will be one iteration of the test for each value.
To run a test case, select it on the Test tab and click the Run button. This opens the Test Runner
window (Figure 56-16). This window shows a list of steps and marks the progress of the tester. As
you complete each step, you can mark it as passed or failed.
1108 .
chaPter 56 ViSuAl STudio ulTimATe For TeSTerS
fiGure 56-16
You can record the steps of a manual test as you go through, which allows you to
automate the process when you want to re-run the test later.
On the toolbar of the Test Runner window are buttons that allow you to attach items to the results
of this test run, including comments, screenshots, files, and even a whole snapshot of the system that
developers can use later to help in debugging issues. You can create bugs directly from this toolbar
as well.
lab center
If you click the Testing Center heading you can switch over to the Lab Center (Figure 56-17). The
Lab Center is used to manage the environments that you will be running tests on. This can include
information on physical and virtual environments.
To use the features of Lab Center, you need to install a Test Controller and associate it with a project
collection in your Team Foundation Server. Once your Test Controller is available, you are able to use
the Lab Center to maintain a collection of Physical Machines, Virtual Machines and Virtual Machine
Templates. When a tester starts up a test he will be connected to one of these machines and if he spots an
error he can take a system snapshot, which will be attached to the bug report. When a developer retrieves
the bug, he can reconnect to the test machine and have it be put back into this state by the test controller.
Test and lab Manager .
1109
fiGure 56-17
To configure the data that is collected on each machine in the environment, use the Data and
Diagnostics page on the Test Settings tab (Figure 56-18). You can collect many different kinds of
data, from mouse clicks and keyboard strokes to full video of the desktop during the test.
fiGure 56-18
1110 .
chaPter 56 ViSuAl STudio ulTimATe For TeSTerS
suMMary
In this chapter you saw the different types of automated tests included in Visual Studio 2010. You
started with Web Tests, which allow you to reproduce a set of requests, and then you continued
with Load Tests, which help to simulate several users executing your tests simultaneously to stress
your application. You also looked at automating your application with Coded UI Tests, which
helps to test the ways in which your user will interact with your system. Generic Tests can be used
to wrap existing tests that are using other mechanisms, and Ordered Tests can help you run a
set of tests sequentially. You learned how to map unit tests onto the code that it tests with Code
Coverage tools and how that information is used to determine which tests need to be run when the
code changes. Finally, you looked at options to manage your tests, like grouping them in lists and
publishing the results to Team Foundation Server.
The new Test and Lab Manager is a tool that is targeted at helping testers do their jobs. By creating
test cases and organizing them into plans you can more easily manage testing tasks, and integration
with Team Foundation Server makes it easy to track progress and communicate results with the rest
of the team.
57 57
Team foundation server
what’s in this chaPter?
.
Managing project tasks
.
Visualizing source code repository changes
.
Creating build configurations
.
Reporting progress
.
Customizing process templates
Software projects are notoriously difficult; very few are delivered successfully on time, within
budget, and up to the desired quality levels. As software projects get larger and require larger
teams, the processes involved in managing them gets even more complicated, and not just for
the manager, but for the developers, the testers, the architects, and the customer. Over time
there have been many approaches to solving software project management problems, including
quality models like CMMI, methodologies such as RUP, or Agile Practices, Scrum, and
Continuous Integration. Clearly a tool to help support all the pieces necessary to ensure more
successful software projects should be desired.
The most basic requirement for a software project, even for the smallest one-person project,
is to have a source control repository. For bigger ones more sophisticated features are needed,
such as labeling, shelving, branching, and merging. Project activities need to be created,
prioritized, assigned, and tracked, and at the end of the day (or better yet even before every
change is checked in to your repository) you need to ensure that everything builds and all
tests are passing. To make this process smoother and improve team communication, a way to
report to project managers or peer developers is also required.
Team Foundation Server (TFS) 2010 allows you to do all this. In this chapter you see how
version control works, how it integrates with work item tracking, and how each change can be
checked to ensure it is working before it is checked in. You also see how project managers can
1112 . chaPter 57 TeAm FoundATion SerVer
see reports to get a better understanding of the project status and how they can work using Excel
and Project to assign work items. The team can interact using the project ’ s portal in SharePoint and
different stakeholders can get the information they need through the report server or confi gure it to
get their reports directly by e - mail.
TFS 2010 has a few new features that make it easier to get up and running,
including reduced requirements and streamlined installation. You can even
install it on a client operating system like Windows 7.
teaM ProJect
To begin working with TFS you need to create a team project . A team project contains all of the
information about your project, including source code, tasks that need to be performed, instructions
for building your application, documentation, quality metrics, and planning information. Each team
project can also have its own SharePoint collaboration portal.
In Visual Studio 2010, team projects are grouped together under team project collections . All of the
projects with a team project collection share basic infrastructure such as a data warehouse, a work
item schema, and a pool of IDs (for work items and changeset numbers). If you have logical groups
of projects within your enterprise, it is a good idea to create a team project collection for each one.
You cannot back up and restore individual projects. This can only be done at the
project collection level.
Process teMPlates
When you create a new team project, you
need to select the process template , which
defi nes the way in which you intend to use
the tool. Select the one that better suits your
organization ’ s process or methodology. Out of
the box, Team Foundation Server comes with
two templates, both based on the Microsoft
Solution Framework. One fl avor is for Agile
Development and the other is for CMMI
Process Improvement. Both options are great
as starting points, but if your company has a
defi ned process it can be incorporated into TFS
or you can use a third - party process template.
Figure 57 - 1 shows the process template selection
process. The rest of this chapter uses MSF for
Agile Software Development and refers to the
CMMI version when necessary. fiGure 57 - 1
Work item Tracking .
1113
A process template creates the environment for the team project. This usually consists of defining
work item types (as you see in the section titled “Work Item Tracking”), creating default groups
and permissions, preparing a version control repository, and configuring reports and a custom
SharePoint portal with document structure and process guidance. A different process could omit
some of these or add custom tasks.
When the wizard finishes it opens the Guidance Page, which details the process used, defines the
responsibilities of the roles involved, explains the different types of work items, and provides
step-by-step guidance about specific tasks like “How to create a Vision Statement.” Figure 57-2
shows the Project Guidance and the Team Explorer windows.
You navigate to the different features of TFS through the Team Explorer tool window. It has Work
Item Queries, a convenient way to access the documents stored in the Team Portal, links to Reports,
a list of the Team Builds, and the Source Control node.
fiGure 57-2
work iteM trackinG
Team Foundation Server allows you to manage activities using work items. As you see in the
following sections, you can search for work items using work item queries and you manage them
using Visual Studio, Excel, Project, or Team System Web Access. Different types of work items are
defined by your process template.
1114 . chaPter 57 TeAm FoundATion SerVer
work item queries
The work items shown in Figure 57 - 3 are all tasks in the selected team project. You can look for
different work items using the work item queries from Team Explorer. The template process includes
14 team queries (Figure 57 - 2) such as Active Bugs, Open Issues, or My Work Items.
One of the most requested features leading up to TFS 2010 was hierarchical
work items. TFS now provides this capability, so you can create sub - tasks
and parent tasks. You can also create predecessor and successor links between
work items, which enables you to manage task dependencies. These new work
item links will even synchronize with Microsoft Excel and Microsoft Project
providing even greater fl exibility for managing work items.
fiGure 57 - 3
Most of the time those queries will be enough, but you have the option to create new ones. If you ’ re
a project administrator you can add new team queries to make them available to everyone with
access to this project. If you can modify the process template, you can add new team queries, so
projects created with the edited templates will include them. Changes in the templates don ’ t apply to
team projects already created. If you don ’ t have these permissions or you want to create a personal
query, you can do that, too.
There is a folder of queries called Workbook Queries, which are used to support
some of the Excel workbook reports found in the Documents area.
To create a new query, right - click the My Queries node and select New Query (Figure 57 - 4).
Now you can visually design your query. In this case you only care about the work items of the
selected project, assigned to the current user and under Iteration 1. You specify this using the
@me and @Project variables. You can also specify which columns you want visible in the grid and
sorting options (Figure 57 - 5). You can then run the new query to see a sub - list of the work items.
When you notice you are creating the same queries over and over from one
project to another, you should add those to your process templates. Over time,
there will be less need to create custom queries.
fiGure 57 - 4 fiGure 57 - 5
In Team Foundation Server 2010, queries can take advantage of the new hierarchical work item
structure to show work items that are directly related, allowing you to see the impact of cutting
a feature or the required tasks necessary to complete a feature. You can also show query results
in a fl at list, a list of work items and their direct links, or a tree of work items. Each of these is
identifi ed by a small icon that appears next to the query in the Team Explorer. You can create folder
structures for your work item queries and each query or folder can be secured separately.
Although a folder of work item queries can be secured, there is nothing stopping
unauthorized users from duplicating the queries for themselves.
work item types
In MSF for Agile Development you have six types of work items: bugs, issues, shared steps, tasks, test
cases, and user stories. Each work item has different fi elds depending on its type. For example, a bug
Work item Tracking . 1115
1116 .
chaPter 57 TeAm FoundATion SerVer
will have test information and a system info field, whereas a task contains effort information about
estimated, remaining, and completed hours. Contrasting it with the MSF for CMMI template, you have a
change-request work item, which doesn’t exist in the Agile version. CMMI also has a bug work item, but
in this case it is not so simple; it now requires repro steps and has other fields such as severity, priority,
probability, and estimate. All these fields are customizable either at a template or team-project level.
adding work items
The basic way of adding work items is via the Team . Create Work Item menu option and selecting
the work item type you want to add. Another convenient way to add work items is through the Test
Results window (Figure 57-6).
fiGure 57-6
When you do it this way you will usually create