cc01.indd 201.indd 2 112/11/2012 11:43:44 am2/11/2012...

30

Upload: dodang

Post on 12-Sep-2018

217 views

Category:

Documents


0 download

TRANSCRIPT

c01.indd 2c01.indd 2 12/11/2012 11:43:44 AM12/11/2012 11:43:44 AM

PROFESSIONAL

TEAM FOUNDATION SERVER 2012

INTRODUCTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .xxvii

� PART I GETTING STARTED

CHAPTER 1 Introducing Team Foundation Server 2012 . . . . . . . . . . . . . . . . . . . . . . . . . 3

CHAPTER 2 Planning a Deployment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .13

CHAPTER 3 Installation and Confi guration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43

CHAPTER 4 Connecting to Team Foundation Server . . . . . . . . . . . . . . . . . . . . . . . . . . 59

� PART II VERSION CONTROL

CHAPTER 5 Overview of Version Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83

CHAPTER 6 Using Team Foundation Version Control . . . . . . . . . . . . . . . . . . . . . . . . . . 95

CHAPTER 7 Ensuring Code Quality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .147

CHAPTER 8 Migration from Legacy Version Control Systems . . . . . . . . . . . . . . . . . . .177

CHAPTER 9 Branching and Merging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193

CHAPTER 10 Common Version Control Scenarios . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223

� PART III PROJECT MANAGEMENT

CHAPTER 11 Introducing Work Item Tracking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243

CHAPTER 12 Customizing Process Templates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273

CHAPTER 13 Managing Teams and Agile Planning Tools . . . . . . . . . . . . . . . . . . . . . . . 311

CHAPTER 14 Reporting and SharePoint Dashboards . . . . . . . . . . . . . . . . . . . . . . . . . . 333

CHAPTER 15 Project Server Integration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 359

� PART IV TEAM FOUNDATION BUILD

CHAPTER 16 Overview of Build Automation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 373

CHAPTER 17 Using Team Foundation Build . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 389

CHAPTER 18 Customizing the Build Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437

(Continued)

ffirs.indd iffirs.indd i 12/11/2012 12:00:52 PM12/11/2012 12:00:52 PM

� PART V ADMINISTRATION

CHAPTER 19 Introduction to Team Foundation Server Administration . . . . . . . . . . . 493

CHAPTER 20 Scalability and High Availability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 525

CHAPTER 21 Disaster Recovery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 549

CHAPTER 22 Security and Privileges . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 575

CHAPTER 23 Monitoring Server Health and Performance . . . . . . . . . . . . . . . . . . . . . . 599

CHAPTER 24 Testing and Lab Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 627

CHAPTER 25 Upgrading from Earlier Versions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 657

CHAPTER 26 Working with Geographically Distributed Teams . . . . . . . . . . . . . . . . . . 675

CHAPTER 27 Extending Team Foundation Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 695

INDEX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 725

ffirs.indd iiffirs.indd ii 12/11/2012 12:00:52 PM12/11/2012 12:00:52 PM

PROFESSIONAL

Team Foundation Server 2012

Ed BlankenshipMartin Woodward

Grant HollidayBrian Keller

ffirs.indd iiiffirs.indd iii 12/11/2012 12:00:52 PM12/11/2012 12:00:52 PM

Professional Team Foundation Server 2012

Published byJohn Wiley & Sons, Inc.10475 Crosspoint BoulevardIndianapolis, IN 46256www.wiley.com

Copyright © 2013 by John Wiley & Sons, Inc., Indianapolis, Indiana

Published simultaneously in Canada

ISBN: 978-1-118-31409-8ISBN: 978-1-118-43932-6 (ebk)ISBN: 978-1-118-60452-6 (ebk)ISBN: 978-1-118-60460-1 (ebk)

Manufactured in the United States of America

10 9 8 7 6 5 4 3 2 1

No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning or otherwise, except as permitted under Sections 107 or 108 of the 1976 United States Copyright Act, without either the prior written permission of the Publisher, or authorization through payment of the appropriate per-copy fee to the Copyright Clearance Center, 222 Rosewood Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 646-8600. Requests to the Publisher for permission should be addressed to the Permissions Department, John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ 07030, (201) 748-6011, fax (201) 748-6008, or online at http://www.wiley.com/go/permissions.

Limit of Liability/Disclaimer of Warranty: The publisher and the author make no representations or warranties with respect to the accuracy or completeness of the contents of this work and specifi cally disclaim all warranties, including without limitation warranties of fi tness for a particular purpose. No warranty may be created or extended by sales or pro-motional materials. The advice and strategies contained herein may not be suitable for every situation. This work is sold with the understanding that the publisher is not engaged in rendering legal, accounting, or other professional services. If professional assistance is required, the services of a competent professional person should be sought. Neither the pub-lisher nor the author shall be liable for damages arising herefrom. The fact that an organization or Web site is referred to in this work as a citation and/or a potential source of further information does not mean that the author or the publisher endorses the information the organization or Web site may provide or recommendations it may make. Further, readers should be aware that Internet Web sites listed in this work may have changed or disappeared between when this work was written and when it is read.

For general information on our other products and services please contact our Customer Care Department within the United States at (877) 762-2974, outside the United States at (317) 572-3993 or fax (317) 572-4002.

Wiley publishes in a variety of print and electronic formats and by print-on-demand. Some material included with standard print versions of this book may not be included in e-books or in print-on-demand. If this book refers to media such as a CD or DVD that is not included in the version you purchased, you may download this material at http://booksupport.wiley.com. For more information about Wiley products, visit www.wiley.com.

Library of Congress Control Number: 2012950503

Trademarks: Wiley, the Wiley logo, Wrox, the Wrox logo, Programmer to Programmer, and related trade dress are trade-marks or registered trademarks of John Wiley & Sons, Inc. and/or its affi liates, in the United States and other countries, and may not be used without written permission. [Insert third-party trademark information] All other trademarks are the property of their respective owners. John Wiley & Sons, Inc., is not associated with any product or vendor mentioned in this book.

ffirs.indd ivffirs.indd iv 12/11/2012 12:00:54 PM12/11/2012 12:00:54 PM

To Mom, Dad, Nathan, Tiffany, Zach, Daniel, Mike,

and Grandma, and to all those on the product teams

that make this an amazing product that positively

impacts so many in the software engineering

community.

—Ed Blankenship

To Catherine.

—Martin Woodward

To my wife, Emma.

—Grant Holliday

ffirs.indd vffirs.indd v 12/11/2012 12:00:54 PM12/11/2012 12:00:54 PM

EXECUTIVE EDITOR

Robert Elliott

PROJECT EDITOR

Christina Haviland

TECHNICAL EDITORS

Steve St. Jean

Brian Keller

PRODUCTION EDITOR

Kathleen Wisor

COPY EDITOR

Mike LaBonne

EDITORIAL MANAGER

Mary Beth Wakefi eld

FREELANCER EDITORIAL MANAGER

Rosemarie Graham

ASSOCIATE DIRECTOR OF MARKETING

David Mayhew

MARKETING MANAGER

Ashley Zurcher

BUSINESS MANAGER

Amy Knies

PRODUCTION MANAGER

Tim Tate

VICE PRESIDENT AND EXECUTIVE

GROUP PUBLISHER

Richard Swadley

VICE PRESIDENT AND

EXECUTIVE PUBLISHER

Neil Edde

ASSOCIATE PUBLISHER

Jim Minatel

PROJECT COORDINATOR, COVER

Katie Crocker

PROOFREADER

Jennifer Bennett

INDEXER

Robert Swanson

COVER DESIGNER

Ryan Sneed

COVER IMAGE

© Steve Pepple / iStockphoto

CREDITS

ffirs.indd viffirs.indd vi 12/11/2012 12:00:54 PM12/11/2012 12:00:54 PM

ABOUT THE AUTHORS

ED BLANKENSHIP works at Microsoft as the program manager for the Lab and Environment Management scenarios of the Visual Studio ALM and Team Foundation Server product family. His expertise with Team Foundation Server and Visual Studio ALM began with the beginnings of the product family nearly seven years ago.

Before joining Microsoft, Ed was awarded as a Microsoft Most Valuable Professional (MVP) for fi ve years. He was voted in 2010 as the Microsoft MVP of the Year for Visual

Studio ALM and TFS by his peers. Ed was also a TFS consultant and the ALM practice technical lead at Imaginet (formerly Notion Solutions). Prior to consulting, Ed was the Release Engineering Manager at Infragistics, where he led a multiyear Team Foundation Server and Visual Studio Team System implementation globally to improve the development process life cycle.

Ed has authored and served as technical editor for several Wrox books. He has also authored numerous articles and spoken at various user groups, events, radio shows, and conferences, includ-ing TechEd North America. You can fi nd him sharing his experiences at his technical blog at www.edsquared.com and on Twitter with his handle @EdBlankenship.

MARTIN WOODWARD is a senior program manager for Microsoft Visual Studio Team Foundation Server specializing on the Eclipse and Cross-Platform Tooling. Before joining Microsoft, Martin was awarded MVP of the Year for Visual Studio Application Lifecycle Management and he has spoken about Team Foundation Server at events internationally. When not working or speaking, Martin can be found on his blog at http://www.wood-wardweb.com or on the podcast at http://radiotfs.com.

GRANT HOLLIDAY is a senior premier fi eld engineer (PFE) for Microsoft Services in Australia. As a PFE, he works with customers to perform proactive health checks and workshops on Team Foundation Server. Prior to this role, he spent three years in Redmond, Washington, as a Program Manager in the Visual Studio Team Foundation Server product group. He was responsible for the internal TFS server deployments at Microsoft, including the largest and busiest TFS server in the world used by Developer Division. Grant was also involved in the early stages of getting the Team Foundation

Service up and running on the Windows Azure platform. Grant shares his thoughts on his blog at http://blogs.msdn.com/granth and presentations at industry events.

BRIAN KELLER is a Principal Technical Evangelist for Microsoft specializing in Visual Studio and application lifecycle management. Brian has presented at conferences all over the world and has managed several early adopter programs for emerging Microsoft tech-nologies. Brian is a regular personality on MSDN’s Channel 9 website, and he is cohost of the popular show “This Week on Channel 9.” Brian has coauthored multiple books on Visual Studio and application lifecycle management. Brian was also one of the technical editors on this book.

ffirs.indd viiffirs.indd vii 12/11/2012 12:00:54 PM12/11/2012 12:00:54 PM

ABOUT THE CONTRIBUTOR

STEVEN ST. JEAN is a senior ALM consultant with Imaginet (formerly Notion Solutions), a full-service consultancy working at the cutting-edge of Microsoft technologies. He has 20 years of industry experience, the past seven focused on assisting clients with maturing their development processes including the use of the Microsoft tools stack. He is a Microsoft MVP in Visual Studio ALM, a certifi ed professional in Team Foundation Server (TFS), and technical editor of a number of books pertaining to ALM and TFS. He speaks on various ALM process and tooling topics at user groups and code camps. In his free time he enjoys spending time with his wife and daughters, travel-ling, and photography. You can fi nd his technical blog at http://sstjean.blogspot.com and his Twitter handle is @SteveStJean. Steven was also one of the technical editors on this book.

ffirs.indd viiiffirs.indd viii 12/11/2012 12:00:55 PM12/11/2012 12:00:55 PM

ACKNOWLEDGMENTS

I WANT TO THANK everyone involved with putting this book together, including the author team, editors, reviewers, and everyone who was able to give us great feedback and help along the way! Thanks to Martin, Grant, Brian, and Steve for the great teamwork and contributions that have made this book awesome. I have really appreciated you guidance along the way as well as all of the new things that I learned from each of your expertise. I truly enjoyed working with y’all.

The help from the each of the product teams to put together such a great product can’t be dis-counted either. A personal thanks to Brian Harry, Sam Guckenheimer, Matt Mitrik, Mario Rodriguez, Anu, Muthu, Aseem, Nipun, Satinder, Gregg Boer, Jim Lamb, Jason Prickett, Chad Boles, Phillip Kelley, Christophe Fiessinger, and Chris Patterson on the product teams at Microsoft. I appreciate all of your contributions, advice, and primarily your in-depth insight into the product over the years that has helped develop a better understanding of all the moving wheels of Team Foundation Server.

I also want to thank my former Microsoft MVP colleagues who have been a great group to be a part of, as well as to work with now. A special thanks goes to Mike Fourie, Tiago Pascoal, Anthony Borton, Steve Godbold, Mickey Gousset, Steve St. Jean, Chris Menegay, Dave McKinstry, Joel Semeniuk, Adam Cogan, and Neno Loje for all of your help.

Thank you to everyone who has helped me throughout my career over the years. Thanks for pushing me to get better in my craft, and for fueling my enthusiasm. Thanks also to my family and friends for their guidance along the way and their constant support. I couldn’t have done this without each of you.

—Ed Blankenship

FIRST, I WOULD LIKE to thank my coauthors, Ed, Grant, and Brian, for allowing me to help them in putting this book together. I would also like to thank Steve St. Jean for his help and his attention to detail. You will struggle to meet a group of folks who know the breadth of Team Foundation Server better than these guys do, and it is a pleasure to work with them all.

My colleagues in the entire Team Foundation Server group (past and present) have obviously been essential in the making of this book, and I would like to especially acknowledge the help, advice, and assistance from the following people both inside and outside Microsoft: Aaron Hallberg, Philip Kelley, Chad Boles, Buck Hodges, Matthew Mitrik, James Manning, Jason Prickett, Ed Holloway, Doug Neumann, Ed Thomson, Peter Provost, Terje Sandstrom, and William Bartholomew. I also want to thank the ALM Rangers and ALM MVPs that make the Team Foundation Server community such a vibrant one to be in.

ffirs.indd ixffirs.indd ix 12/11/2012 12:00:55 PM12/11/2012 12:00:55 PM

Finally, I would like to thank my wife, Catherine. I owe Catherine so much for so many things, both big and small. I know that she signed up for “in sickness and in health” on that wonderful day in Newcastle when she agreed to be my wife, but I’m pretty sure she’d have thought again if our vows had been “in sickness and in health, through the course of four books, and the countless nights apart or vacation days messed up due to my husband not understanding the term work/life bal-ance.” However, luckily for me she’s a woman who keeps her promises. And I aim to spend the rest of my days trying to make her understand how grateful I am. For everything.

—Martin Woodward

I’D LIKE TO THANK everyone who made this book possible. Once again, we formed the dream team of Team Foundation Server knowledge and experience. Thank you to my coauthors, Ed, Martin, Steve, and Brian. Thank you to the Wiley project team for keeping us on track and helping with the polish and production effort that a technical book like this deserves.

Secondly, I’d like to thank the Microsoft Services team in Australia and the worldwide Premier Field Engineering team. As I returned home after some time in Corp, you have welcomed me with open arms into your organizations—I am truly honored to call myself a PFE. A big thank you to Brian Harry and the Team Foundation Server team in Redmond and Raleigh. The TFS team are truly world-class in their customer focus and I am lucky to work with such great technical talent.

Finally, I’d like to thank my family for all the late nights and weekends it took to get this over the line.

—Grant Holliday

ffirs.indd xffirs.indd x 12/11/2012 12:00:55 PM12/11/2012 12:00:55 PM

CONTENTS

INTRODUCTION xxvii

PART I: GETTING STARTED

CHAPTER 1: INTRODUCING TEAM FOUNDATION SERVER 2012 3

What Is Team Foundation Server? 3

What’s New in Team Foundation Server 2012 5

Version Control 5

Code Reviews 6

Managing Personal Work 6

Web Access 6

Project Management 7

Agile and Scrum Product Management 7

Stakeholder Feedback 7

Build 7

Acquisition Options 7

Team Foundation Service 8

Express 9

Trial 9

Volume Licensing 10

MSDN Subscriptions 10

Microsoft Partner Network 11

Retail 11

Summary 11

CHAPTER 2: PLANNING A DEPLOYMENT 13

Identifying and Addressing Software Engineering Pain 13

Transparency into the Release or Project 14

Collaboration Across Diff erent Teams and Roles 15

Automated Compilation, Testing, Packaging, and Deployment 15

Managing Test Plans 15

Parallel Development 15

Adopting Team Foundation Server 16

Adoption Timeline 16

Phased Approach 17

ftoc.indd xiftoc.indd xi 12/11/2012 12:00:02 PM12/11/2012 12:00:02 PM

xii

CONTENTS

Hosting Team Foundation Server 18

Identifying Aff ected Teams 19

Generating Consensus 19

Team Foundation Server Administrator 20

Pilot Projects 21

Migration Strategies 21

Version Control 21

Work Item Tracking 22

Structuring Team Project Collections and Team Projects 23

Considering Limitations in Team Foundation Server 25

Server Limitations 28

Preparation for a Team Foundation Server Environment 29

Understanding the Architecture and Scale-Out Options 29

Hardware Requirements 32

Virtualization 33

Planning for Software Prerequisites 34

Service Accounts 37

File Share Folders 38

SMTP Server 38

Firewall Concerns and Ports Used 39

Friendly DNS Names 39

Legacy Visual Studio Versions 41

Summary 42

CHAPTER 3: INSTALLATION AND CONFIGURATION 43

What You’ll Need 44

Team Foundation Server 2012 44

Team Foundation Server 2012 Installation Guide 45

SQL Server 2012 45

Operating System 46

SharePoint 46

Client Software 47

Service Packs and Other Updates 47

Installing Team Foundation Server 48

Installation Types 49

Confi guring Team Foundation Server 51

Creating Your First Team Project 56

Confi gure Friendly DNS Names 57

Summary 58

ftoc.indd xiiftoc.indd xii 12/11/2012 12:00:02 PM12/11/2012 12:00:02 PM

xiii

CONTENTS

CHAPTER 4: CONNECTING TO TEAM FOUNDATION SERVER 59

Team Foundation Server Architecture 59

Addressing Team Foundation Server 61

Introducing Team Foundation Server Security and Roles 63

Users 63

Groups 64

Permissions 65

Team Explorer 65

Understanding Team Explorer in Visual Studio 66

Connecting to Team Foundation Server from Eclipse and Cross-Platform 71

Alternate Ways to Connect to Team Foundation Server 74

Accessing Team Foundation Server Through a Web Browser 74

Using Team Foundation Server in Microsoft Excel 75

Using Team Foundation Server in Microsoft Project 76

Windows Explorer Integration with Team Foundation Server 77

Connecting Microsoft Test Manager to Team Foundation Server 78

Access to Team Foundation Server via Third-Party Integrations 79

Summary 80

PART II: VERSION CONTROL

CHAPTER 5: OVERVIEW OF VERSION CONTROL 83

What Is Version Control? 83

Repository 84

Working Copy 85

Working Folder Mappings 85

Get 86

Add 86

Check-out 86

Changeset 87

Check-in 87

History 87

Branching and Merging 88

Common Version Control Products 88

Microsoft Visual SourceSafe 89

Apache Subversion 89

ftoc.indd xiiiftoc.indd xiii 12/11/2012 12:00:02 PM12/11/2012 12:00:02 PM

xiv

CONTENTS

Team Foundation Server 90

Distributed Version Control Systems 91

Summary 93

CHAPTER 6: USING TEAM FOUNDATION VERSION CONTROL 95

Getting Started with Team Foundation Server Version Control 96

Learning what’s New in Team Foundation Server 2012 Version Control 98

Team Foundation Server Version Control Concepts 99

Workspace 99

Working Folder Mappings 103

Get 107

Check-out 109

Locks 109

Check-in of Pending Changes 110

Undo Pending Changes 117

Changeset 117

Shelvesets 119

Branches 120

Using Source Control Explorer 121

Viewing History 123

Labeling Files 123

Recovering When Things Go Wrong 124

Keeping on task with My Work 125

Team Foundation Server Version Control in Eclipse 130

Installing the Team Foundation Server Plug-in for Eclipse 131

Sharing Eclipse Projects in Team Foundation Server 133

Importing Projects from Team Foundation Server 135

Diff erences Between the Eclipse and Visual Studio Clients 137

Team Foundation Server Version Control from the Command Line 137

Getting Help 138

Using the Command Line 138

Team Foundation Version Control Power Tools and Third-Party Utilities 139

Microsoft Visual Studio Team Foundation Server Power Tools 139

Team Foundation Server MSSCCI Provider 140

Confi guring Version Control 140

Security and Permissions 140

ftoc.indd xivftoc.indd xiv 12/11/2012 12:00:02 PM12/11/2012 12:00:02 PM

xv

CONTENTS

Switching Version Control to Team Foundation Server 141

Working with Team Foundation Server for Visual SourceSafe Users 142

Using Team Foundation Server for Subversion Users 144

Summary 146

CHAPTER 7: ENSURING CODE QUALITY 147

What Is Quality? 148

Enforcing Quality 149

Check-In Policies 149

Monitoring Check-In Policy Overrides 152

Check-In Policy Pack in Power Tools 154

Creating Custom Check-In Policies 155

Deploying Check-In Policies 159

Gated Check-In 164

Why Gated Check-In? 165

When Not to Use Gated Check-In 166

Setting Up a Gated Check-In Build 167

Checking In for Validation 168

Reconciling the Workspace 168

Managing Code Reviews 170

Requesting a Code Review 171

Performing a Code Review 173

Completing the Code Review 175

Summary 176

CHAPTER 8: MIGRATION FROM LEGACY VERSION CONTROL SYSTEMS 177

Migration Versus Upgrade 178

Upgrade 178

Migration 178

Migrating History or Latest Version 179

Migrating from Visual SourceSafe 180

Preparing to Use the VSS Upgrade Wizard 181

Using the Visual SourceSafe Upgrade Wizard 182

Team Foundation Server Integration Platform 188

Popular Third-Party Migration Tools 190

Subversion, CVS, and StarTeam 190

ClearCase 190

Summary 191

ftoc.indd xvftoc.indd xv 12/11/2012 12:00:03 PM12/11/2012 12:00:03 PM

xvi

CONTENTS

CHAPTER 9: BRANCHING AND MERGING 193

Branching Demystifi ed 193

Branch 194

Merge 194

Confl ict 194

Branch Relationships 195

Baseless Merge 196

Forward/Reverse Integration 196

Common Branching Strategies 196

No Branching 197

Branch per Release 198

Code-Promotion Branching 199

Feature Branching 200

Implementing Branching Strategies 201

The Scenario 202

The Plan 202

Implementation 203

Dealing with Changesets 208

Tracking Change Through Branches 220

Summary 222

CHAPTER 10: COMMON VERSION CONTROL SCENARIOS 223

Setting Up the Folder Structure for Your Branches 223

Application Source Code 224

Automated Tests Source Code 224

Architecture Assets 224

Database Schema 225

Installer Assets 225

Build and Deployment Assets 225

Third-Party Source Code/Dependencies 226

Folder Inside Branch 226

Folder at Team Project Level 228

Internal Shared Libraries 230

Choosing a Location in Version Control 230

Storing Library Assemblies as Dependencies 233

Branching into Product Family Branches 233

Managing Artifacts Using Team Foundation Server 235

SQL Reporting Services Encryption Key Backup 235

Process Templates 236

ftoc.indd xviftoc.indd xvi 12/11/2012 12:00:03 PM12/11/2012 12:00:03 PM

xvii

CONTENTS

Custom Build Assemblies 237

Master Build Process Templates 238

Source Code for Custom Tools 238

Summary 239

PART III: PROJECT MANAGEMENT

CHAPTER 11: INTRODUCING WORK-ITEM TRACKING 243

Project Management Enhancements in Team Foundation Server 2012 244

Rich Work-Item Relationships 244

Test Case Management 245

Enhanced Reporting 245

SharePoint Server Dashboards 246

Agile Planning Tools in Team Web Access 246

Work Items 247

Work-Item Types 247

Areas and Iterations 249

Process Templates 252

MSF for Agile Software Development 253

MSF for CMMI Process Improvement 255

Visual Studio Scrum 258

Third-Party Process Templates 260

Custom Process Templates 260

Managing Work Items 260

Using Visual Studio 260

Using Microsoft Excel 266

Using Microsoft Project 267

Using Team Web Access 268

Using Third-Party Tools 270

Project Server Integration 271

Summary 271

CHAPTER 12: CUSTOMIZING PROCESS TEMPLATES 273

Anatomy of a Process Template 273

Plug-in Files 274

Default Security Groups and Permissions 276

Initial Area and Iteration Nodes 277

Work Item Type Defi nitions 278

ftoc.indd xviiftoc.indd xvii 12/11/2012 12:00:03 PM12/11/2012 12:00:03 PM

xviii

CONTENTS

Initial Work Items 289

Work Item Queries and Folders 289

Microsoft Project Column Mappings 290

Version Control Permissions and Settings 290

SharePoint Project Team Portal Document Library Settings 291

SQL Reporting Services Report Defi nitions 292

Using the Process Template Editor 292

Installing the Process Template Editor 293

Working with a Process Template 293

Using an XML Editor and WITAdmin 294

Deploying Updates to Process Templates 296

Uploading Process Templates in Team Foundation Server 296

Editing Work Items on an Existing Team Project 297

Customizing Agile Tools 298

Metastates 299

Eff ort, Remaining Work, and Stack Rank 299

Defi ning the Team 300

Other Process Confi guration Customizations 300

Common Work Item Type Customizations 301

Adding New States 301

Displaying Custom Link Types 302

Using Display Name Changes (New syncnamechanges attribute) 302

Introducing Custom Work Item Controls 303

Work Item Clients 303

Work Item Control Interfaces 304

Deploying Custom Controls 308

Work Item Custom Control Deployment Manifest 309

Using the Custom Control in the Work Item Type Defi nition 309

Summary 310

CHAPTER 13: MANAGING TEAMS AND AGILE PLANNING TOOLS 311

Defi ning a Team 312

Maintaining Product Backlogs 317

Planning Iterations 319

Tracking Work 322

Customization Options 325

Stakeholder Feedback 326

ftoc.indd xviiiftoc.indd xviii 12/11/2012 12:00:03 PM12/11/2012 12:00:03 PM

xix

CONTENTS

Requesting Feedback 326

Providing Feedback 328

Voluntary Feedback 331

Summary 332

CHAPTER 14: REPORTING AND SHAREPOINT DASHBOARDS 333

What’s New in Team Foundation Server 2012 334

Cross-Collection Reporting Support 334

Changes to the Relational Warehouse 334

Changes to the Analysis Services Cube 335

Optional and Richer SharePoint Integration 337

Team Foundation Server Data Warehouse 337

Operational Stores 338

Relational Warehouse Database and Warehouse Adapters 338

Querying the Relational Warehouse Database 339

Analysis Services Cube 342

Data Warehouse Permissions 344

SharePoint Integration 344

SharePoint Extensions 345

Excel Services and Dashboard Compatibility 345

Creating Reports 347

Tools 347

Excel Reporting from a Work-Item Query 347

SQL Server Reporting Services Reports 349

SharePoint Dashboards 355

Advanced Customization 357

Customizing Project Portals 357

Customizing Warehouse Adapters 357

TfsRedirect.aspx 358

Summary 358

CHAPTER 15: PROJECT SERVER INTEGRATION 359

Overview 359

Project Server Essentials 360

Bidirectional Synchronization 361

Relationship between Team Projects and Enterprise Projects 366

Initial Confi guration 366

Necessary Permissions 366

Command-Line Tool for Confi guration 367

Project Server Installation Components 367

ftoc.indd xixftoc.indd xix 12/11/2012 12:00:03 PM12/11/2012 12:00:03 PM

xx

CONTENTS

One-Time Integration Steps 367

Mapping Enterprise Projects to Team Projects 368

Necessary Software for Project Managers 369

Summary 369

PART IV: TEAM FOUNDATION BUILD

CHAPTER 16: OVERVIEW OF BUILD AUTOMATION 373

Let’s Build Something 373

What Is Build Automation? 374

Scripting a Build 376

Make 376

Apache Ant 377

Apache Maven 378

NAnt 379

MSBuild 379

Windows Workfl ow Foundation 383

Using Build Automation Servers 383

CruiseControl 384

CruiseControl.NET 384

Hudson / Jenkins 384

Team Foundation Server 385

Adopting Build Automation 386

Summary 387

CHAPTER 17: USING TEAM FOUNDATION BUILD 389

Introduction to Team Foundation Build 389

Team Foundation Build Architecture 390

Setting up the Team Foundation Build Service 392

Installing Team Foundation Build 393

Confi guring the Team Foundation Build Service 393

Additional Software Required on the Build Agent 399

Working with Builds 399

Creating a Build Defi nition 399

Queuing a Build 411

Build Notifi cations and Alerts 413

Managing Builds 415

Managing Build Quality Descriptions 420

Managing Build Controllers and Build Agents 420

Understanding the Build Process 422

ftoc.indd xxftoc.indd xx 12/11/2012 12:00:03 PM12/11/2012 12:00:03 PM

xxi

CONTENTS

DefaultTemplate Process 423

Building Ant and Maven Projects with Team Foundation Server 435

Summary 436

CHAPTER 18: CUSTOMIZING THE BUILD PROCESS 437

Introduction to Windows Workfl ow Foundation 438

Visual Basic.NET Expressions 438

Custom Workfl ow Variables 440

Custom Build Parameters 442

Workfl ow Activities 449

When to Use MSBuild versus WF 457

Custom Build Workfl ow Activities 458

How to Create a Custom Build Activity 458

Integrating Activity into the Build Process Template 473

Deployment of Custom Build Activities 478

Customizing the Build Report Output 480

Creating a Log Data Visualizer 480

Build Summary Report Custom Section 481

Customizing the Build Process to Stamp the Version Number on Assemblies 482

Defi ning Custom Build Process Parameters 483

Allowing the Functionality to Be Optional 484

Defi ning Local Workfl ow Variables 485

Initializing the Local Workfl ow Variables 486

Finding Matching Assembly Info Files 486

Adding the Custom TfsVersion Activity 487

Summary 488

PART V: ADMINISTRATION

CHAPTER 19: INTRODUCTION TO TEAM FOUNDATION SERVER ADMINISTRATION 493

Administrative Roles 494

Infrastructure Administrator 494

Team Foundation Server Administrator 494

Project Administrator 494

Logical Architecture 495

Client Tier 496

Application Tier 496

Data Tier 496

ftoc.indd xxiftoc.indd xxi 12/11/2012 12:00:03 PM12/11/2012 12:00:03 PM

xxii

CONTENTS

Built-In Administration Tools 497

Team Foundation Administration Console 498

Command-Line Confi guration Tools 516

Other Administration Tools 519

Team Foundation Server Power Tools 520

Best Practices Analyzer 520

Team Foundation Server Administration Tool 522

Team Foundation Sidekicks 523

Summary 524

CHAPTER 20: SCALABILITY AND HIGH AVAILABILITY 525

An Evolving Architecture 526

Limiting Factors 527

Microsoft Recommendations 527

Data Tier 529

Application Tier 531

Web Access 532

Warehouse 532

Team Foundation Proxy 533

Principles 534

Scale Out To Multiple Servers 535

Eliminate Single Points Of Failure 535

Anticipate Growth 535

Keep It Simple 535

Solutions 535

Data Tier 536

Application Tier and Web Access 539

Virtualization 546

Summary 547

CHAPTER 21: DISASTER RECOVERY 549

Business Continuity and Recovery Goals 549

Defi ning Responsibilities 550

Backing Up Team Foundation Server 550

Components to Back Up 551

Types of Database Backups 552

Important Considerations 554

Creating a Backup Plan 556

Team Foundation Server Backup Plan Details 563

Restoring a Backup to the Original Server 566

Summary 573

ftoc.indd xxiiftoc.indd xxii 12/11/2012 12:00:03 PM12/11/2012 12:00:03 PM

xxiii

CONTENTS

CHAPTER 22: SECURITY AND PRIVILEGES 575

Users 575

Domain Users 575

Local Users 577

Identity Synchronization 577

Groups 579

Domain Groups 580

Distribution Groups 580

Local Groups 580

Team Foundation Server Groups 580

Permissions 583

Server Permissions 584

Team Project Collection Permissions 584

Team Project Permissions 586

Work Item Tracking 587

Version Control Permissions 591

Build Permissions 594

Reporting 594

Security Management 595

Deny, Allow, and Unset Permissions 595

Use Active Directory Groups 596

Avoid Granting Individual User Permissions 596

Use Inheritance 596

Tools 597

Command-Line Tools 597

Summary 597

CHAPTER 23: MONITORING SERVER HEALTH AND PERFORMANCE 599

System Health 600

SQL Server 601

Dynamic Management Views (DMV) 601

Currently Running Processes 602

SQL Wait Types 607

Storage Health 608

Memory Contention 609

Team Foundation Server 610

Command Log 610

Active Server Requests 612

Performance Counters 614

Server Tracing 615

ftoc.indd xxiiiftoc.indd xxiii 12/11/2012 12:00:03 PM12/11/2012 12:00:03 PM

xxiv

CONTENTS

Client Performance Tracing 616

Job History 618

Storage Usage 619

Data Warehouse 621

Tools 621

Performance Analysis of Logs (PAL) Tool 622

Team Foundation Server Best Practices Analyzer (BPA) 623

Team Foundation Server Management Pack for System Center Operations Manager (SCOM) 624

Summary 625

CHAPTER 24: TESTING AND LAB MANAGEMENT 627

Software Testing 628

Test Case Management 629

Lab Management 629

Testing Architecture 630

Microsoft Test Manager 632

Test Plans 633

Test Suites 634

Test Cases 634

Test Runs 634

Exploratory Testing 636

Actionable Bugs 636

Test Settings 636

Test Attachments Cleaner 638

Assigning a Build to a Test Plan 639

Analyzing Impacted Tests 640

Build Retention 640

Custom Work Item Types 641

Test Automation 641

Visual Studio Lab Management 643

What’s New for Lab Management in Team Foundation Server 2012 644

Installing and Confi guring Lab Management 645

Maintaining a Healthy Test Lab 652

Troubleshooting 655

Summary 656

ftoc.indd xxivftoc.indd xxiv 12/11/2012 12:00:03 PM12/11/2012 12:00:03 PM

xxv

CONTENTS

CHAPTER 25: UPGRADING FROM EARLIER VERSIONS 657

Overview 658

In-Place Upgrades Versus Migrating to New Hardware 658

Planning Upgrades 660

Upgrading Prerequisites 661

SQL Server 662

SharePoint 662

Project Server 663

System Center 663

Using the Confi guration Utility 663

Upgrade Wizard 664

Verifi cation of Upgrade 665

Upgrading Legacy Team Projects 666

Feature Enablement 667

Allowing Access to Premium Features 669

Automated Builds 670

Enable Local Workspaces 672

Deploying New Reports 672

Deploying New SharePoint Team Portal Site 672

Upgrading Lab Management Environments 673

Summary 674

CHAPTER 26: WORKING WITH GEOGRAPHICALLY DISTRIBUTED TEAMS 675

Identifying the Challenges 676

Latency Over the Wide Area Network (WAN) 676

Sources of Network Traffi c 677

Solutions 679

Central Server with Remote Proxy Servers 679

Multiple Distributed Servers 679

Mirroring 680

Remote Desktops 680

Internet-connected “Extranet” Server 680

Metadata Filtering 680

Build Servers 681

ftoc.indd xxvftoc.indd xxv 12/11/2012 12:00:03 PM12/11/2012 12:00:03 PM

xxvi

CONTENTS

Local Build Server Farm 681

Remote Build Server Farm 681

Team Foundation Server Proxy 682

How the Team Foundation Server Proxy Works 682

Compatibility 682

Confi guring Proxies 682

Seeding Proxies 685

Personal Proxies 685

Mirroring with the Team Foundation Server Integration Tools 686

Capabilities 686

Examples 688

Working Offl ine 689

Version Control 689

Forcing Offl ine 690

Work Items 691

Other Considerations 692

Maintenance Windows and Time Zones 692

Online Index Operations with SQL Server Enterprise 693

Distributed Application Tiers 693

SQL Mirroring 694

Summary 694

CHAPTER 27: EXTENDING TEAM FOUNDATION SERVER 695

Extensibility Points 696

.NET Client Object Model 697

Connecting to the Server 698

Handling Multiple API Versions 699

Distributing the Client Object Model 701

SOAP Event Subscriptions 701

Available Event Types 702

Building an Endpoint 703

Adding the Subscription 704

Listing All Event Subscriptions1 705

Server Object Model 705

Server Extensibility Interfaces 705

Server Plug-Ins 708

Visual Studio Extensibility 721

Other Resources 723

Summary 724

INDEX 725

ftoc.indd xxviftoc.indd xxvi 12/11/2012 12:00:03 PM12/11/2012 12:00:03 PM

INTRODUCTION

OVER THE PAST DECADE, Microsoft has been creating development tools that have been designed for the ever-growing engineering teams of software developers, testers, architects, project managers, designers, and database administrators. In the Visual Studio 2012 line of products, there are tools for each team member to use to contribute to a software release. However, it’s not enough to allow for awesome individual contributions. You must also organize the collaboration of those contributions across the larger team, including the stakeholders for whom the software is being built.

Beginning in the Visual Studio 2005 release, Microsoft introduced a new server product named Team Foundation Server to complement its development products. Now in its fourth release, Team Foundation Server 2012 has grown with all of the investment from the past decade and fi ts nicely in the Visual Studio application lifecycle management (ALM) family of products. Before the Visual Studio 2010 release, the Visual Studio ALM family of products was given the brand of Visual Studio Team System, which is no longer used in the latest releases.

As you will fi nd out, Team Foundation Server is a very large product with lots of features for man-aging the software development lifecycle of software projects and releases. The authors of this book collectively gathered from their past experience since the fi rst release of Team Foundation Server to document some of the tips and tricks that they have learned along the way. The backgrounds of the authors are quite diverse—managing one of the largest Team Foundation Server environments, designing the collaboration pieces for non-.NET development teams, evangelizing the Visual Studio and Team Foundation Server products, managing releases at a software development company, and a consulting background where customers are helped each week to solve real-world challenges by taking advantage of Team Foundation Server.

WHO THIS BOOK IS FOR

If you have been looking to Team Foundation Server to meet some of your software development team’s challenges for collaboration, then this book is for you. You may have seen the Team Foundation Server product in your MSDN subscription and decided to set up a new environment internally. You may now be wondering how to administer and confi gure the product. You may have also noticed the new, hosted Team Foundation Service offering by Microsoft and wondered where to get started.

This book is for everyone ranging from the developer using Team Foundation Server for day-to-day development, to the administrator who is ensuring that the environment is tuned to run well and build extensions to the product to meet the needs of their software development team. You may also be preparing for any of the new Application Lifecycle Management (ALM) Microsoft certifi cation exams for administering or using Team Foundation Server, and you will fi nd many of the exam top-ics covered in this book.

This book does not require any knowledge of Team Foundation Server to be useful, but it is not meant for developers or testers who are just starting out their craft. Team Foundation Server can be

flast.indd xxviiflast.indd xxvii 12/11/2012 12:01:15 PM12/11/2012 12:01:15 PM

xxviii

INTRODUCTION

used for teams as small as one to fi ve team members to teams consisting of tens of thousands. Code samples in the book are presented in C#, but they could also be implemented in other .NET lan-guages (such as Visual Basic.NET).

You can fi nd a road map for the book based on your team role later in this “Introduction” under the section named “How This Book Is Structured.”

WHAT THIS BOOK COVERS

This book covers a complete overview of the Team Foundation Server 2010 product and provides hands-on examples for using the product throughout many of the chapters. This book only covers the latest version of Team Foundation Server 2010 (including Service Pack 1 in some areas) and does not expose the reader to how to use earlier versions of Team Foundation Server.

The book is divided into fi ve main parts, with detailed chapters that will dive into each of the fea-ture areas of Team Foundation Server 2010.

‰ Part I—Getting Started

‰ Part II—Version Control

‰ Part III—Project Management

‰ Part IV—Team Foundation Build

‰ Part V—Administration

HOW THIS BOOK IS STRUCTURED

You may have picked up this book and are wondering where to get started. This book has been written so that you start reading in a particular chapter without needing to understand concepts introduced in previous chapters. Feel free to read the book from cover to cover, or, if you are in a hurry or need to reference a specifi c topic, jump to that particular chapter. The next sections describe where you might get started in the book based on your role and the topics that might be most relevant for you.

Developers

There are plenty of features that are available for developers who are using Team Foundation Server. You might begin by reading Chapter 4, “Connecting to Team Foundation Server,” to get started with exploring the different options available for connecting to your server.

After that, you can begin your review of the version control features available in Part II of the book:

‰ Chapter 5—“Overview of Version Control”

‰ Chapter 6—“Using Team Foundation Version Control”

‰ Chapter 7—“Ensuring Code Quality”

flast.indd xxviiiflast.indd xxviii 12/11/2012 12:01:15 PM12/11/2012 12:01:15 PM