Showing posts with label VSTS. Show all posts
Showing posts with label VSTS. Show all posts

Thursday, June 14, 2007

VSTS Scrum process templates

There have been some rumblings around that some in my company might be interested in Scrum and Team System, so I thought I'd compile a list of Scrum process templates and some highlights (and lowlights).  The three Scrum process templates I've found are:

Each process template adds custom work items and reports related to Scrum, but they all have their quirks and niceties.

Scrum for Team System

This process template was originally released a year ago by a company called Conchango.  You can find this template on the Scrum for Team System website at http://www.scrumforteamsystem.com/.  I've personally used this template for about 10 months covering about a dozen Sprints.

Pros

  • Great website with thorough process guidance and free training videos
  • Mature, with several updates to the template
  • All sprint artifacts present, with automatic rollup calculations
  • Good reports, including:
    • Sprint Burndown
    • Product Burndown
    • Product Backlog Composition
    • and about a dozen more
  • Portal reports, a set of smaller reports designed for the project SharePoint portal
  • Support through forums
  • Widely adopted
  • Includes tool to update warehouse (critical for up-to-date reports, as Team System only updates the warehouse ever hour or so)

Cons

  • All artifacts created and managed through Visual Studio, which not all team members may have
  • Reports have a lot of custom code, making them difficult to tweak
  • Does not plug in to the Areas and Iterations constructs already present in Team System
  • Only one active project per Team Project
    • i.e., everyone in the same Team Project will use the same sprints, work items, etc. with no good way to partition them
    • This forces every new team to have a new Team Project

Microsoft eScrum

This one was just released from Microsoft, and from the description, looks like it's been used internally at Microsoft.  I found this on a post on Rob Caron's blog.  That post links to a download on Microsoft's downloads site here.  I should note that I tested all of these process templates using a Team System VHD, so I didn't have to get access to our corporate Team System server.

Pros

  • Fantastic web portal for managing sprints and sprint artifacts.  It's all Ajax-y too.
    • Pages for managing daily sprints, reports, etc.
  • Context-sensitive help in web portal
  • Dynamic capacity calculations in portal
  • All sprint artifacts present
  • Ability to have multiple "Products" in one Team Project in source control, allowing multiple teams to use Scrum for one Team Project
  • Allows definitions of each role (Project Member, Product Owner, etc.)
  • Some better options on each work item type, such as categories
  • Integrates with Areas and Iterations
    • Areas are Products
    • Iterations are Sprints

Cons

  • New, released only on June 12
  • No support through forums, or anywhere else online (Google only found 2 relevant pages)
  • Painful setup, lots of manual steps
  • Not as many reports (~half a dozen)

VSTS Scrum Process Template from CodePlex

I also found this one on the post on Rob Caron's blog.  At the bottom of the post, it links to the CodePlex project.  This project was intended to improve on the Scrum for Team System process template by taking advantage of Areas and Iterations.  It's being developed by a handful of TFS MVP's.

Pros

  • Lightweight, fits in well with Areas and Iterations
  • Good list of reports, some of them quite different than the other templates
    • Unplanned work
    • Quality Indicators
    • Project Velocity
    • Builds
  • Supports basic Scrum/Agile work items (User Story, Backlog Item, etc.)
  • Custom work item for reviews
  • Open source, so it's updated frequently

Cons

  • Open source, so don't look for great support
  • Still in beta
  • Not a lot of people using it
  • No project portal
  • No installer

Summing it up

The Conchango process template is by far the most mature, so I'd usually go with that one, but the awesome portal site and the integration into Areas and Iterations make the eScrum process template a compelling alternative.  As for the CodePlex template, it looks promising, but I'll reserve judgement until a final version is released.  Doesn't look ready for prime time quite yet.  The great thing about process templates is that you can edit them after you create the Team Project.  If there's a report missing you want, it's pretty easy to look at one of the other process templates and see what others are doing, and add whatever you need.

Wednesday, June 6, 2007

Team Foundation Build, Part 4: Values, Principles, and Practices

In the last post of this series, I discussed how to create a build definition. Before I start discussing extending and customizing Team Foundation Build, I think it's important to discuss some values, principles, and practices regarding automated builds and continuous integration. To establish some context, I suggest reading the original Martin Fowler article on CI (Continuous Integration).

When looking at extending a build, it's difficult to see which direction to go without having a target or destination in mind. The idea behind having values and principles is to create a shared target that the team tries to hit. I'm paraphrasing Kent Beck and Martin Fowler quite a bit, so apologies in advance if these ideas are old news to you.

Values, Principles and Practices

Values and principles are a set of ideas that a team believes are important or worthwhile. By themselves, they can be vague as they aren't specific towards a specific domain. But without clear values and principles, the practices the team tries to enforce will have little or no meaning. Values and principles establish a context and meaning to practices, and practices are followed to reinforce a set of values and principles.

Practices are a concrete set of actionable items. They are either done or not done, and there is no gray area. Whether or not you have followed a practice is very clear. A set of practices go hand in hand with values, as Kent Beck says, "Just as values bring purpose to practices, practices bring accountability to values".

Values and Principles

So if a team decides that it is important to have values regarding builds and integration, what should these values be? I've suggested a few, but these could be expanded and modified depending on the context of the team. It's not important that these specific values be agreed upon, but that the team communicates and agrees upon some set of values.

Feedback

The only constant of software development is change. Change comes in many forms, whether it is requirements, environments, personnel, etc. It then follows that the software itself is in a constant state of change. Developers are modifying code, adding features, fixing bugs, refactoring, simplifying. But how do we know if the changes we're making are successful or even correct? Change necessitates feedback, and feedback validates changes (or invalidates).

Change happens on a constant basis, so feedback should happen early and often to handle the constant changes. The longer we wait to receive feedback on changes, the more difficult it will be to decipher the feedback. The shorter the feedback loop is, the greater chance we will get meaningful and actionable feedback.

Simplicity

Simplicity is far more difficult to achieve than complexity. However, complex systems take more time to understand and change than simple systems. The simpler the system is, the easier change becomes. Since change is constant in software, optimizations should be made towards simplicity over most anything else.

Maintainability

Simplicity leads to greater maintainability. A maintainable system is a system that is easy to change. Maintainability can be achieved through simplicity, clarity, and solubility. If I can look at a piece of a system and understand its role or behavior in less than ten seconds, it's highly soluble, and therefore maintainable. If a codebase has a solid suite of unit tests with high coverage rates, the codebase is maintainable because the unit tests enable change.

Practices

Practices are the kinds of things you do day-to-day. They're not really in place as a set of goals themselves, since enforcing the values is our true goal. It's important to always keep the core values in mind when following the practices, and sometimes it doesn't make sense to follow all of the practices. But understanding the values behind the practices will provide context for discussing whether or not to follow each practice. The following build practices are designed to reinforce the values and principles defined above.

Single source repository

A single source repository is the single truth of the state of the system. Developers can be editing code on each of their systems, but having a single source repository enforces a single point of reference for keeping and finding source code and other information.

Single source repositories don't have to only store code, nor can source repositories be only code repositories. SharePoint is a type of repository that can store documents. When you store a document in SharePoint, no one argues which email attachment document is the correct document from whatever email you received. There's only one document, and one place to find it.

Automate the build

Human intervention is a typical source for errors in manual processes. To me, automation is just another way of eliminating duplication in processes. I don't want to duplicate my manual actions every day if I can have a reliable way to automate it. I'll probably screw something up. The more a process is automated, the less likely it is to fail. We're also less likely to forget to do the manual process in the first place. Builds can be complex, and with rich build tools available in nant and MSBuild, there's no reason not to automate the build.

Self-testing build

So we've automated our build, and our code compiled without errors. But is that sufficient for a successful build? In addition to merely compiling the code, our build should also run tests against the compiled code for further verification. Does our code meet specifications and requirements? After all, two developers could check in code that compiles successfully but blows up at runtime, or doesn't pass customer acceptance testing. By having a self-testing build, we can receive deeper feedback from our builds.

The tests your builds can run can vary depending on how often the builds run. I posted a while back on classifying tests, and when looking at what tests to run, the length of time it takes to run your tests is generally proportional to how often you want to run them. If it takes 3 hours to run a test suite, you can't run these tests in a build that builds every hour.

Everyone commits every day

The longer you wait to commit changes, the more difficult it will be to integrate those changes. Let's suppose I'm changing module A that depends on module B. While I make my changes, developer Joe makes several changes to module B. He adds a couple of features, changes some behavior, maybe even modifies the interface of a couple of classes that I use. If I make a 100 changes in a week, that's a lot of changes that could potentially break because of Joe's modifications. Maybe it's only the changes on the first day that broke, but now it's Friday and I don't remember exactly all of the changes from the first day.

The longer I wait to elicit feedback, the less useful that feedback becomes. If I commit daily, the most amount of changes I need to worry about is only what I did yesterday.

Every commit should build

Following the message of getting feedback early and often, I should build every time I check in to get feedback from the build. If I have an automated, self-testing build, it would be easy to set off a build often. If I commit a dozen changes, and then build, I have a lot more to worry about if the build breaks or a test fails. It could be any one of those dozen changes that broke the build, and it's up to me to wade through them all to figure out which one. I should instead add one change at a time, incrementally adding functionality and getting feedback from the build that I haven't broken anything.

I like to compare this to the construction of a building. The builders don't wait until the entire building is finished to see if it's built right, they make small changes and additions, measuring and verifying as they go, until the structure is complete. If they wait until the building is finished, it's several magnitudes of order more expensive to fix problems that could have been caught early on.

Keep the build fast

Also known as the 10-minute build rule. If every commit sets off a build, I don't want to have to wait to get feedback. Any longer than 10 minutes might mean I've moved on to something else, and lost the internal stack of ideas in my head that I used to build the original change. What ends up happening in reality is that teams have several types of builds. Usually there is a "CI build" that runs on every commit, and it only builds and runs unit tests. The longer the build takes to run, the less often the build should execute. A deployment build that runs lengthy regression tests could run nightly.

I don't like to be kept waiting for feedback. If I ask someone a question in a conversation and they wait 5 minutes to answer, I've already walked away. Builds are the other entity in the daily conversation of development, always answering the question, "Is what I just checked in correct?" The quicker I get the answer, the quicker I can move on.

Everyone can see what's happening

The entire team should be aware at all times of the statuses of the build(s). Since the build output is the final result of the team's production, it's in the team's best interest to keep the build "green", or successfully run. When it's easy to see the status, you can start putting some rules in place:

  • The whole team drops everything to fix a broken build
  • Nobody checks in when a build is broken or in progress
  • Nobody leaves after checking in a change until the build is green
    • In other words, don't check in something and go home without verifying the build is green

When results and status are visible, the team accepts responsibility and becomes accountable for the build. If no one can tell what the status of the build is, no one will care.

Automated deployment

Manual deployments seem to be one of the biggest headache-inducers in development. Any manual process, no matter how explicitly defined in a Word document or Excel spreadsheet, is inherently error-prone because it requires human action on each step. Humans are...well, human, and mistakes will happen. Having an automated deployment eliminates the human error of a manual deployment.

You can also go one step further and have a self-testing deployment, running the same tests that the builds executed. Having a automated, self-testing deployment would save countless hours of time spent diagnosing and troubleshooting deployment problems. Deployments are stressful enough, I'd like to have some confidence in what I'm deploying with an automated, self-testing process.

Summing it up

By themselves, each practice is valuable. Together, the build practices multiply their collective value significantly. To introduce these practices, always start with automating the build and work your way down the list. It's not very effective to have a self-testing build if the builds aren't automated, as adding tests to a manual process would just make life more difficult and this practice would likely be dropped. Automation is a great enabler, as it allows much richer and complex processes to be possible.

I should also point out that these values, principles, and practices should be discussed and agreed upon in the team, not dictated to the team. Ideas agreed upon are much stronger than rules forced upon. In the final post in this series, I'll look at customizing and extending Team Build to enable you to follow these build practices.

Thursday, May 24, 2007

TFS Guide now available

One thing I always thought was missing from MSDN regarding TFS was any kind of guidance or best practices.  Just released was a Beta 1 of a TFS Best Practices guide, and after taking a quick look at the contents (over 300 pages) it has a ton of great information.  The section on Team Build is worth its weight in gold, as it not only covers good build practices, but relates them to Team Build.

TFS Guide homepage

Latest Release

This document was put out by the Microsoft Patterns and Practices team, and while the document is a Beta, and it's easy to go straight to the guidance you need.  It even has a whole chapter dedicated to Continuous Integration, though it does have the caveat "Team Foundation Server 2005 does not provide a CI solution out of box".  TFS does provide the framework to support it, so you have tools like TeamCI, TFS Integrator, and Automaton.  Also nice is a chapter on Large Project Considerations, and many other chapters have sections dedicated to large project considerations.

The book is laid out into separate parts:

  • Fundamentals
  • Source Control
  • Builds
  • Large Project Consideration
  • Project Management
  • Process Templates
  • Reporting
  • Setting Up and Maintaining

It finishes out with a list of:

  • Guidelines
  • Practices
  • Questions and Answers
  • How Tos

All in all, a pretty nice reference, and something I really wish I had a year ago.

Team Foundation Build, Part 3: Creating a Build

In part 1 and 2 of this series, I gave an overview of Team Foundation Build and discussed installation and configuration options.  One thing I should note is that if a team needs to add custom tasks to the build that are in separate assemblies, these assemblies need to be copied to the build machine.  That implies that the dev team probably needs administrator access to the build machine.

In VSTS, build definitions are called Build Types, and are created through the Team Explorer.  Creating a Build Type is accomplished through a wizard, which will walk you through the steps of defining the build.  So what does Team Build provide out of the box?  Namely, what are the build steps involved?  First, Team Build will:

  • Synchronize with source control
  • Compile the application
  • Run unit tests
  • Perform code analysis
  • Release builds on a file server
  • Publish build reports

So out of the box, we don't have to worry about configuring source control, compiling, and other common tasks that we would otherwise need to define ourselves.  When I launch the New Team Build Type Creation Wizard from Team Explorer, the wizard walks me through the following steps:

  • Create a new build type
  • Select the solutions to build
  • Select a configuration and platforms for build
  • Select a build machine and drop location
  • Select build options

I'll walk through each of these steps one by one.

Step 1: Create a new build type

In the first screen, you need to specify the name of your Build Type.  Unfortunately, all Build Types are grouped in one folder in source control, so we have to use names instead of folders to distinguish different builds.  Naming conventions can help that situation, so something like <Application>_<Version>_<Region>_<BuildType> would work.  In the past, I've defined several builds for the same application, like "Deploy", "Nightly", "CI", etc.  Build Type names can be a pain to change, so choose your Build Type names carefully.

Step 2: Select the solutions to build

Build Type definitions allow you to select one or more Visual Studio solutions to build.  In most cases, you would have only one solution to build, but if there are more than one solution to build, you can select multiple and specify the order that each solution will be compiled.  If SolutionA depends on SolutionB, just have SolutionB build before SolutionA.

Step 3: Select a configuration and platforms for build

In this screen, you can specify the project configuration you would like to build with.  Typically this could be "DEBUG", "RELEASE", or any custom project configurations you might have.  Typically, I might have a separate project configuration like "AUTOMATEDDEBUG" that might add code analysis.  I usually leave the platform to "Any CPU", but if you have specific platform requirements, this is where you would specify that.

Step 4: Select a build machine and drop location

When specifying the build machine, Team Build needs two pieces of information:

  • What is the name of the build machine?
  • What directory on the build machine should I build in?

The build machine is the machine that has Team Build Service installed on it.  The directory can be anything, but keep in mind that you don't necessarily want all builds being built in the same directory.  Team Build is good about separating builds in the file system, but I've had hard drives fill up when I had too many builds going on the same machine

The other piece of information in this step is the drop location.  When Team Build finishes compiling and testing, it will copy the files to a UNC share you specify here.  Don't worry, if you need additional files dropped, you can customize this later in the Build Type definition.

Step 5: Select build options

This step is entirely optional (but strongly recommended).  You can specify that you would like this build to run tests and perform code analysis.  If you select "Run test", you will need to specify the test metadata file (*.vsmdi) and the test list to run.  In my last project, we had over 1300 unit tests when I left, which was absolutely impossible to manage in a test list.  We used custom task to specify our tests to run, which would use reflection to load the tests dynamically.

The other option available is code analysis, which is important for enforcing coding guidelines and standards.  Without code analysis turned on, you'll probably have a different coding standard for every developer who touched the code.

Step 6: Finish

When you complete the wizard, two new files are created in source control:

  • TfsBuild.proj - this is the Build Type definition, where you'd put any customization
  • WorkspaceMapping.xml - definition of the source control workspace, where you can change the build directory

You can find these files in the source control explorer in $/[Team Project]/TeamBuildType/[Build type name].  Manually going through source control is a little bit of a pain if I want to edit the TfsBuild.proj file, so I use Attrice's Team Foundation Sidekick add-in, which lets my right-click and check out and check in directly from Team Explorer.

So that's it!  To start a new build just right-click the Build Type in Team Explorer and select "Build".  Double-clicking the Build Type will bring up a list of all of the builds with their statuses.  This is also where you can view the details of an individual build.

In the next posts, I'll detail some values, principles, and practices when it comes to automated builds, as well as some discussion on customizing and extending a Build Type definition.

Wednesday, May 23, 2007

Team Foundation Build, Part 2: Installation and Configuration

So now that we have some understanding of what the components of Team Build are from Part 1, where should these components be installed? Luckily, there's some pretty good documentation on Team Foundation Server components and topologies on MSDN.

Lots of arrows and boxes, but the main point of this diagram is that Team Build is installed on a separate box from the Application Tier (Team Foundation Server or TFS Proxy) and from any client machines. A build machine should only have software installed to support the execution of a build. You shouldn't install:

  • Third-party control packages
  • Database client tools (Toad, SQL Server Client Tools, etc.)
  • Anything that would push assemblies into the GAC

Ideally, all you would have installed would be:

  • Team Build
  • Team Edition for Developers (for static analysis)
  • Team Edition for Testers (for running tests during a build)

Anything else installed could potentially cause build errors because the build might use incorrect versions of third party libraries when compiling. That's why it's always best to check in all third-party libraries into source control, instead of relying on installers to get them to work. For a detailed installation guide, check out the Team Foundation Installation Guide.

Another piece to note on the diagram above is the upper-right hand corner, noted as the "Build Drop site". This could be a file server or a share on the buildserver, where the compiled assemblies, log files, etc. are dropped. In the next post, I'll discuss creating a Team Build definition and an introduction into extending the build.

Tuesday, May 22, 2007

Team Foundation Build, Part 1: Introduction

There's been some interest recently for our team to utilize more features of Team System, including Team Foundation Build.  Rather than send out a blanket email, I'm following Jon Udell's advice and maximizing the value of my keystrokes by posting a series of blog entries on this topic.

Visual Studio Team System introduced quite a few productivity enhancements for development teams including work items, process templates, reporting, source control, and builds.  Team Foundation Build is the build server component of VSTS.  Build definitions in VSTS are:

  • Managed in Team Explorer
  • Represented by MSBuild scripts
  • Stored in Team Foundation Source Control
  • Executed on a build machine by the Team Build Service
  • Can be initiated through Team Explorer
  • Report results to Team System

So why should we use Team Build over a home grown solution like batch files, Nant scripts, etc.?

Centralized management

All builds are defined, managed, and viewed through Team Explorer.  Since builds are stored in source control, we get all of the benefits source control provides, such as versioning, security, etc.  We also have one central repository to view and edit builds.  I can double-click a build definition to view all of the executed builds with status (success/failure), and drill down into a single build to view more details.  If I'm using ReSharper, I get IntelliSense and refactoring tools for MSBuild.

Defined with MSBuild

MSBuild is the new build platform for Visual Studio.  Project files (.vsproj, .vbproj, etc.) are now defined as MSBuild scripts.  Tasks in MSBuild are customizable and extensible, so I can define new tasks and use community built tasks.  Team Build definitions also allow extensibility points, similar to the ASP.NET page event model, by extending certain targets such as "BeforeGet", "AfterTest", and "AfterDropBuild".

Status and reporting

There are usually two pieces of information I'm curious about when looking at builds:

  • What is the status of the current build? (In progress, successful, failed)
  • Is there a trend in the build statuses?

All of this information can be seen through Team Explorer.  Additionally, I've seen tray icon applications that will display a red, yellow, or green light indicating the status of a certain build definition.

Where do we go from here?

In coming posts, I'll discuss installation and configuration, defining builds, and outlining a set of values, principles, and practices Team Build can be used to encourage and enforce.  I'll also outline some ideas on what kinds of build definitions are good to have, and what kinds of activities we might want to accomplish as part of our builds.

Thursday, May 17, 2007

Project management with Microsoft Office SharePoint Server

Having used Team System in the past, I've been trying to wrap my head around using Team System for work items in our group.  We're using Team System exclusively for source control, but there's a lot more functionality available to use.  At the heart of a Team System project is the process template, which creates the work item templates, reports, and the team portal page.  The problem I'm seeing is that our Team Project, scoped for source control, spans many groups, many internal projects, many versions, and many global teams.  We have Core, Back End, Personalization, Front End, B2B, etc. applications.  We have 2.1, 2.1.5, and 2.2 versions.  We have Global, Asia Pacific, US/CA, Latin America, and Europe regions.  All of these different groups, concerns, and project requirements are under a single Team Project.  How are we supposed to create a single process template that could possibly work?

What Team System can give us

In my last project, we used Scrum as our development process, and Scrum for Team System as our process template.  For those unfamiliar with Scrum, it is a lightweight, incremental and iterative development process that breaks the development cycle into iterations called "sprints".  Each sprint is timeboxed, such that no extra work can be assigned nor can the length of the iteration be changed during the sprint.  Time and requirements are fixed during the sprint.

All development we did was driven off of requirements that were defined and managed from Team System.  When we checked in code, we associated the check-in with a work item.  When we ran builds, we could see what checkins were part of that build, what comments were available, and what work items were worked on for that build.  Additionally, we no longer needed any status meetings, since individual team members would update the work remaining of their work items every day.  Burndown charts told us (and management) if we were on track or not.  Reports told us at any given time:

  • Progress against the work committed for the current sprint
  • Progress against the work committed for the current release
  • Status of individual features or user stories (not started, in progress, ready for test, complete)
  • Hierarchical composition of features and tasks, with effort and work remaining

Call me crazy, but I think it's perfectly reasonable to let the team members be responsible for keeping the status of their tasks up to date and not the project manager.  All of this information was available at any time, in real time, and always represented the "truth" of the project status.

Current issues

The problem with our current layout for our Team Project is that it spans so many teams, so many projects, and so many geographical groups.  For a process template to be effective for this topology, it would need to be

  • Generalized so we don't pigeon hole all teams into a monolithic process
  • Flexible to handle different process needs and schedules
  • Extensible to allow modifications and additions

I'm a big fan of self-organizing teams.  We have a lot of intelligent people on our team, we should be able to decide how best to work.  Process templates are pretty much set in stone once the Team Project is created, so I don't see a whole lot of value applying a process template to the topology we have now in our source control.  With Scrum, we had a Sprint Retrospective after each sprint to look at improving our process.  This regular feedback would be tough, if not impossible to act on if we have to approve changes across a global team.

The SharePoint solution

I recently ran across another solution to this problem that used SharePoint.  Instead of Team System to manage the Product Backlog and Sprint Backlog, you can use SharePoint lists to house these artifacts.  You can still use Excel for reports, and SharePoint includes a powerful search feature that Team System doesn't have.  What you would lose is the ability to link to work items as you can in Team System.  But without completely changing the topology of our Team Projects to project-based, I just can't see us being able to take advantage of the process templates in Team System.  SharePoint also gives you custom views on top of your data, and those look to be a little bit easier to use than the custom queries and reports in Team System.

The cool thing about a SharePoint solution is that it wouldn't be tied to Team System, so each team could manage their own team project however they wish.  You give up some in the integration that Team System provides, but you can gain some by allowing each team to take responsibility for their process.  If some teams have well-defined and mature development processes, some meta-elements could eventually be developed into a framework for a process template (I'm a big proponent of harvested frameworks).  Since the reality is we can't do whole team together, SharePoint is a great solution to enable collaborative, communicative teams.