Book Image

Microsoft Team Foundation Server 2015 Cookbook

By : Tarun Arora
Book Image

Microsoft Team Foundation Server 2015 Cookbook

By: Tarun Arora

Overview of this book

Team Foundation Server (TFS) allows you to manage code repositories, build processes, test infrastructure, and deploy labs. TFS supports your team, enabling you to connect, collaborate, and deliver on time. Microsoft's approach to Application Lifecycle Management (ALM) provides a flexible and agile environment that adapts to the needs of your team, removes barriers between roles, and streamlines processes. The book introduces you to creating and setting up team projects for scrum teams. You'll explore various source control repositories, branching, and merging activities, along with a demonstration of how to embed quality into every code check-in. Then, you'll discover agile project planning and management tools. Later, emphasis is given to the testing and release management features of TFS which facilitate the automation of the release pipeline in order to create potentially shippable increments. By the end of the book, you'll have learned to extend and customize TFS plugins to incorporate them into other platforms and enable teams to manage the software lifecycle effectively.
Table of Contents (16 chapters)
Microsoft Team Foundation Server 2015 Cookbook
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Preface

Visual Studio is a suite of Microsoft Developer Tools and Services, a few key ones being Visual Studio IDE, Visual Studio Code, Visual Studio Team Services, and Visual Studio Team Foundation Server (TFS). Back in November 2004, Microsoft released its first version of integrated Application Lifecycle Management (ALM) tool, called "Microsoft Visual Studio Team Systems". Over the last 15 years, the product has gone through several evolutions, each enriching the developer experience and the scope of tooling:

Visual Studio – Any App Any Developer

The Visual Studio family of tools and services now enables heterogeneous software development across various platforms. The experience of using open source tooling within the product has improved tremendously. Open source solutions are being given first class citizen status, and more of these solutions are being pre-packaged into the product. This gives us a clear indication that Microsoft wants to become the platform of choice for every developer, independent of the technology or platform. There is a huge overlap between the tools and services within the Visual Studio family of tools. This book focuses entirely on Visual Studio Team Foundation Server 2015.

Microsoft Visual Studio Team Foundation Server 2015 is at the center of Microsoft's ALM solution, providing core services such as version control, Work Item tracking, reporting, and automated builds. TFS helps organizations communicate and collaborate more effectively throughout the process of designing, building, testing, and deploying software, ultimately leading to increased productivity and team output, improved quality, and greater visibility of an application's life cycle.

Software delivery itself has gone through a revolution in the last decade. The introduction of Agile practices and lean frameworks, such as Scrum, Kanban, XP, and RUP, among others, have demonstrated that iterative feedback-driven development helps to cope with changes in the marketplace, business, and user requirements. Lean processes also help minimize waste and maximize value delivery to end users. Better DevOps practices encouraging continuous integration, continuous deployment, continuous delivery, and continuous feedback along with better tooling are enabling organizations to break the silos between teams. Mission-critical applications may still choose to deliver using Waterfall, while a line of business applications may find more success choosing lean methodologies. There is no right or wrong in this; choose the process and tools that are most appropriate to your delivery scenario. Visual Studio TFS supports most processes out of the box, and gives you the flexibility to customize and define processes that work best for your organization.

Visual Studio Team Foundation Server 2015, henceforth referred to as TFS in this book, is Microsoft's on-premise offering of ALM Tooling. Microsoft also offers a cloud-hosted service called Visual Studio Team Services (VSTS). Do not confuse VSTS for being Visual Studio IDE in the cloud; it is instead a collection of developer services comparable to TFS that run on Microsoft Azure and extend the development experience in the cloud. Microsoft is really committed to its hosted service, and has moved it into a 3-week cadence. All features are released in VSTS first, and then, most features are rolled into TFS via quarterly updates. A timeline of features released and those planned in the future releases can be found at https://www.visualstudio.com/en-us/news/release-archive-vso.aspx. The product teams solicit new feature requests via user voice. If you have a burning idea for a feature, be sure to log your request at https://visualstudio.uservoice.com/forums/121579-visual-studio-2015. VSTS now offers a lot of enterprise features such as guaranteed uptime, single sign on using ADFS and AAD, and compliance to US, European, and Australian data sovereignty laws by offering tenants hosted in those regions. Though VSTS boasts of having over 3 million active users, organizations that need more control of the environment and their data will still prefer TFS over VSTS.

Note

All recipes in this book are designed for TFS; however, because of the overlap between VSTS and TFS, most of what you learn in this book is applicable to VSTS.

The various clients that can be used to connect to TFS can be broadly divided into two groups—primary clients, and task-specific clients, as shown in the following screenshot. A full list of the functions that can be performed using these clients can be found at https://msdn.microsoft.com/en-us/library/ms181304.aspx.

If you're setting up TFS for personal use, or to evaluate the core features, such as version control, build, and Work Item tracking, use TFS Express. It's free, it's simple to set up, and it can be installed on both client and server operating systems. Express does not support integration with SharePoint or Reporting Services. If you are setting up TFS for your organization, use the standard version of TFS. You can set up TFS on a single computer, in a dual server configuration, or in a multi-server configuration. Use the following handy reference to check the compatibility matrix for TFS 2015:

https://msdn.microsoft.com/Library/vs/alm/TFS/administer/requirements

The TFS architecture setup and network and port requirements can be found at https://msdn.microsoft.com/en-us/library/ms252473(v=vs.120).aspx. The product setup documentation can be found at https://msdn.microsoft.com/en-us/Library/vs/alm/TFS/setup/overview. The planning and disaster recovery guidance (http://vsarplanningguide.codeplex.com/) from ALM Rangers is very useful when planning an enterprise grade TFS setup. TFS 2015-specific license updates will be covered in the Assigning a license, adding users, and auditing user access recipe in Chapter 1, Team Project Setup. To learn more about the license requirements for TFS, please read through the Visual Studio and MSDN Licensing white paper at http://www.microsoft.com/en-gb/download/details.aspx?id=13350.

The recipes in this book require a standard one machine setup of TFS. You can set up a standalone single server using the preceding installation instructions, or, alternatively, use a preconfigured TFS 2015 Virtual Machine. Instructions to download and set this up can be found at http://vsalmvm.azurewebsites.net/.

What this book covers

Chapter 1, Team Project Setup, covers Team Project, which is a logical container isolating all tools and artifacts associated with a software application together in a single namespace. Features such as Welcome pages, Dashboards, Team Rooms, and many more enable better collaboration within Teams, whereas the ability to rename Team Projects and scripting Team Project creation empowers you to better administer a Team Project. In this chapter, we'll learn the different features of a Team Project and how to set up these features to leverage them to their full potential.

Chapter 2, Setting Up and Managing Code Repositories, introduces TFS, which is the only product to offer a centralized as well as distributed version control system. In this chapter, we'll learn how to set up both TFVC and Git repositories in a single project and how to tackle technical debt by enforcing code reviews and code analysis into the development workflows.

Chapter 3, Planning and Tracking Work, explains the requirements that are implemented but never used, or those that are used just long enough to identify that they don't satisfy the needs of the users cause and waste, re-work, and dissatisfaction. In this chapter, we'll learn how to set up and customize multiple backlogs, Kanban, and Sprint Task Board. We'll also learn how to integrate with external planning tools using Service Hooks, and how to improve the feedback loop by leveraging the feedback features in TFS.

Chapter 4, Building Your Application, introduces the new build system (TFBuild), which is a cross platform, open, and extensible task-based execution system with a rich web interface that allows the authoring, queuing, and monitoring of builds. In this chapter, we'll learn how to set up and use TFBuild for continuous integration. We'll also learn how to integrate TFBuild with SonarQube and GitHub. We'll also review features that help lay the foundations for continuous delivery of software.

Chapter 5, Testing Your Application, states that low quality software just isn't acceptable. But you may ask "what is the right level of quality?" In this chapter, we'll learn how to plan, track, and automate using the testing tools available in TFS. We'll also learn how to leverage the new build system to integrate non-Microsoft testing frameworks, such as Selenium and NUnit, into the automation testing workflows.

Chapter 6, Releasing Your Application, explains the new web-based Release Manager in TFS that uses the same agent and task infrastructure offered by TFBuild. In this chapter, we'll learn how to set up, secure, and deploy to multiple environments using release pipelines. We'll also learn how to track and report on releases delivered through the release pipeline. The techniques in this chapter enable you to set up your software for continuous delivery.

Chapter 7, Managing Team Foundation Server, teaches you how to update, maintain, and optimize your TFS, enabling high availability for geo-distributed Teams and reducing the administration overheads.

Chapter 8, Extending and Customizing Team Foundation Server, explains that it is not uncommon for organizations to have different tools to manage different parts of the life cycle, for example, Jira for Agile project management, TeamCity for builds, Jenkins for release management, and ServiceNow for service management. In this chapter, we'll learn about the TFS object model and TFS REST APIs to programmatically access and integrate with systems. In this chapter, we'll also cover how to customize Team Projects by leveraging Process Template customization.

What you need for this book

The recipes in this book are based on Team Foundation Server 2015. All recipes have been tested with the TFS 2015 Update 1 setup. To work through the recipes, you'll need a working setup of Team Foundation Server 2015 with Visual Studio 2015.

Who this book is for

This book is for all software professionals, including developers, testers, architects, managers, and configuring analysts, using or planning to use TFS.

The book covers the functions of Team Foundation Server 2015, including Team Projects, Source Control, Work Items, Build, Test, Release, Administration, Extensibility, and Customization with focus on DevOps and ALM-centric topics.

This book provides hands-on recipes to leverage new and existing features of TFS for Scrum Teams to enable continuous delivery of high quality software, faster. Rather than just covering the theoretical concepts, each recipe uses a cookbook format that presents a problem, solution, and explanation, taking you directly into real-world practical usage scenarios.

The book assumes you have a working setup of Team Foundation Server 2015 and basic knowledge of TFS, Software Development Lifecycle, and Scrum framework.

Sections

In this book, you will find several headings that appear frequently (Getting ready, How to do it, How it works, There's more, and See also.)

To give clear instructions on how to complete a recipe, we use these sections as follows:

Getting ready

This section tells you what to expect in the recipe, and describes how to set up any software or any preliminary settings required for the recipe.

How to do it…

This section contains the steps required to follow the recipe.

How it works…

This section usually consists of a detailed explanation of what happened in the previous section.

There's more…

This section consists of additional information about the recipe in order to make the reader more knowledgeable about the recipe.

See also

This section provides helpful links to other useful information for the recipe.

Conventions

In this book, you will find a number of text styles that distinguish between different kinds of information. Here are some examples of these styles and an explanation of their meaning.

Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "The tfsdeleteproject command carries out the deletion in two phases."

A block of code is set as follows:

# User-specific files
*.suo
*.user
*.sln.docstates
# Specific files 
*.txt
# Build results
[Dd]ebug/
[Rr]elease/

Any command-line input or output is written as follows:

refs/heads/master, TF402455: Pushes to this branch are not permitted; you must use pull requests to commit changes.

New terms and important words are shown in bold. Words that you see on the screen, for example, in menus or dialog boxes, appear in the text like this: "From the Projects and My Teams submenu, click on New Team Project...."

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or disliked. Reader feedback is important for us as it helps us develop titles that you will really get the most out of.

To send us general feedback, simply e-mail , and mention the book's title in the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide at www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

You can download the example code files from your account at http://www.packtpub.com for all the Packt Publishing books you have purchased. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you could report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website or added to any list of existing errata under the Errata section of that title.

To view the previously submitted errata, go to https://www.packtpub.com/books/content/support and enter the name of the book in the search field. The required information will appear under the Errata section.

Piracy

Piracy of copyrighted material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works in any form on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at with a link to the suspected pirated material.

We appreciate your help in protecting our authors and our ability to bring you valuable content.

Questions

If you have a problem with any aspect of this book, you can contact us at , and we will do our best to address the problem.