application lifecycle management with tfs
DESCRIPTION
TRANSCRIPT
I am …
Mehdi Khalili Consultant at Readify Code, lead and mentor by day Blog and hack on OSS by night
Blog: www.mehdi-khalili.com Twitter: @MehdiKhalili
Agenda
ALM ALM the TFS way
Team Collections and Team Projects Version Control and branching Build Automation Work Item Tracking Team Collaboration Using Portal Web Access!
Putting it all together
Heads up!
There may be glitches in demos due to our virtual setup
This is not a TFS only talk. We are going to talk about ALM and software processes and
methodologies
TFS Ecosystem
TFS Components: a high level look
A closer look
What have we got here?
A quick tour of our virtual environment Windows Server 2008 SQL Server 2008 R2▪ Database▪ Reporting Services▪ Analysis Services
Windows SharePoint Services 3.0 Team Foundation Server 2010 Visual Studio 2010 Premium
ALM
What is it?
Application Lifecycle Management
“continuous process of managing the life of an application”
Increases productivity Improves quality Accelerates development through
simplified integration Cuts maintenance time Maximizes investments Increases flexibility …
ALM tools
Build management Release/deployment Testing Requirements management Work item management Project management Change management Configuration management ….
ALM with TFS
The most integrated ALM solution in .Net land
ALM with TFS
TFS Backbone (Demo)
A quick tour of the Administration Console Application Tier Team Project Collections▪ Team Projects▪ SharePoint portal▪ Reporting
Build Configurations▪ Build Controllers▪ Build Agents
Team Project Collection
The basic unit of recovery One database per collection Benefits
Scalability: load balance Backup and recovery Security isolation Information sharing
Organizational/team structure
Team Project
The largest unit of work associated with developing a single product or product line
Each collection can have many team projects
Sharing or Isolating Team Projects
Creating Team Projects is time consuming
Per Team Project you will get Milestones and release schedules Areas and Iterations Version Control Settings ALM methodology Process Template and its customization Portal
Team Project Templates
CMMI Agile Scrum
Agile vs. Scrum Templates
Work Item Comparison
Agile Scrum
Bug Bug
Issue Impediment
User Story Product Backlog Item
Task Task
N/A Sprint
Agile vs. Scrum Templates
User Story vs. PBIUser Story Product Backlog Item
Title Title
Description Description
Rank Backlog Priority
Story Points Effort
Business Value Business Value
Acceptance Criteria Acceptance Criteria
Let’s create a Team Project (Demo)
Off to Team Explorer
Customizing Templates (Demo)
Customize a project’s template Customize Project Template
TFS Services
Version Control (System)
AKA Source Control Management
Version Control
A journal of changes to your code All actions are irreversible: if you
make a mistake you can only reverse it by compensating actions (well, except in git which allows you to rewrite the history – oh yeah)
Version Control in TFS in a nutshell
Atomic check-ins Branching and merging Shelving Labeling Concurrent check-outs Check-in policies Association of check-ins with work
items
TFS Version Control (Demo) Add a project to source control Workspaces Get a project Get latest Get specific Check-in Check-out and Lock!!! Undo changes Shelve-sets: shelving and unshelving Move …and Source Control File Types
Source Control Settings (Demo)
Check-out settings Bringing VSS annoyance to TFS!!
Check-in policy Some useful policies And some are unnecessary and
annoying Check-in notes
Branching
The Dark Side of
Version Control!
Branching (perceived) needs
Feature branch Dev branch Release branch Hotfix branch
Integration isolation Technology specific branch
A branching sample
Branching in TFS (Demo)
Create a branch Make some changes on the branch Merge changes back
Make some changes on the branch Make some changes on the mainline Merge changes and resolve the
conflict
THE best branching strategy is
“No Branching”, Says Me
But if you REALLY need branching at least do it on demand
And then do your best to remove the demand ;-)
On-Demand Branching (Demo)
Create a label on the release Do NOT create a branch If you need to fix some bugs on the
release branch off the label
Do NOT forget to merge your changes back
Instead of branching, release frequently
Chrome with hundreds of millions of users is released every six weeks
Chrome Canary is released once a day
Flickr with hundreds of millions of users deploys to production 10 times a day
Or you will get this if you are very lucky
Or this if you are not so lucky
Feature branching “could be” good
You need to maintain workable Mainline
You want to check-in frequently Conflicting needs Feature branching seems like the
solution
But feature branching is painful
From Feature Branching By Martin Fowler
Make feature branching less painful
Make your features small Have very few features in progress Do not create developer silos
Branching is painful. You may reduce the pain; but it is always going to hurt
… or even better avoid branching
Avoid branching using Smaller features Shorter sprints Feature Toggle Branch By Abstraction
… but sometimes you just HAVE to create a branch. That is ok because it should not happen often
Continuous Integration
The relief we are after
So … what is CI?
Integrate your work frequently Everyone checks into Mainline on
daily basis Every commit should be built Builds should include test runs Keep the build fast Keep your tests fast
Use CI to drive your Automated Deployment
Continuous Integration
With or without branches, please continuously integrate back and forward
And do not forget: Mainline is the king!
From Feature Branching By Martin Fowler
Promiscuous Integration
AKA baseless merge in TFS land
Only doable through command prompt This is not a good idea usually
And we never talked about it – alright?!
Version Control: other bits (Demo)
Offline Mode Source History Code Annotation Diff tools
Comparing files Comparing folders
Merge tools Two way merge Three way merge
Build Automation
This is an important part of Continuous Integration
Build Automation in TFS in a nutshell
Several triggers: Manual CI Rolling Builds Gated Check-In Scheduled
From MSBuild in 2008 to WF in 2010 Some are happy and some like me are
sad pandas
Creating a Build Definition (Demo)
Manual: most useful for deployment builds
CI: Good for CI Rolling Build: Useful when you have
a big team and devs check-in very frequently
Gated Check-In: Useful for junior teams and for your Mainline if you have many branches
Schedule: useful for functional tests, nightly builds, …
Build Controller and Agents (Demo)
Setting up a build agent (Demo)
Install TFS on your agent machine Set it up as an agent for the build
controller Give your agents good names Optionally give it some tags You can use tags in your build
definition Or when you queue the build
You can see a list of controllers and agents from team explorer
Queuing a build (Demo)
You can queue The latest code A shelveset A changeset A label
Build Results (Demo)
Test result Broken test could break the build Keeping a build result around Build Log MSBuild Log Drop folder Build folder
TFS Build Notifications (Demo)
Get (late) notifications on builds Desktop notification from TFS Do not rely on it; but having it could
help
Continuous Delivery:what it all boils down to
Remember Chrome and Flickr
If you want to win you should do the same
Keep it flowing
Continuous
Integration
Continuous Testing
Continuous Delivery
Short Feedback
Cycle
Happy Customer
Push Button Deployment
No matter how big your application is, if your deployment takes more than a minute to trigger you are doing it wrong
Some cool tools: MSDeploy TFSDeployer
Database Migration
You need to apply database transformation as part of your push-button deployment
Some cool tools MigratorDotNet DBUP
Config Transformation
Different environments have different settings
To create push-button deployment you need to easily apply config transformations
Some cool tools CodeAssassin.ConfigTransform SlowCheetah
Work Item Tracking in TFS
No CMMI Please!
Work Item Tracking in TFS in a nutshell
Integrated work item tracking system
Integration with Version Control Requirements, tasks, bugs, issues,
test cases Extensible:
Create your custom fields Change the layout Available states State transitions
Work Item Tracking (Demo)
Create a sprint Create iterations and areas Create Product Backlog Item/Story Create tasks and subtasks Create bugs Create impediments Check-in code against a backlog
item Create custom queries
Work Item Excel Integration (Demo)
Editing multiple entries at once Populating your backlog
Product Backlog
Backlog is a living creature!! If your backlog is not growing your
product is dead Backlog MUST be always prioritized Do not forget to groom your backlog The Team should help PO groom the
backlog Prioritize your backlog Backlog MUST be always prioritized
A quick word on prioritization
Kano model helps too
Customer Preferences Attractive One-Dimensional Must-Be Indifferent Reverse
Security in TFS
Authorization Settings
Deny is THE king And then there are administrators▪ Project Collection Administrators▪ Project Administrators▪ Team Foundation Administrators
Allow is the king in the absence of Deny
Unset means denied unless stated otherwise This is where inheritance shines
Server Level Permissions
Administer warehouse Create team project collection Delete team project collection Edit instance-level information Make requests on behalf of others Trigger Events Use full Web Access features View instance-level information
Server Level Security Groups
SharePoint Web Application Services Team Foundation Administrators Team Foundation Service Accounts Team Foundation Valid Users Work Item Only View Users
Team Collection Permissions
Administer shelved changes Administer workspaces Create a workspace Create new projects Delete team project Manage process template Manage build resources Delete team project collection ….
Team Collection Security Groups
Project Collection Administrators Project Collection Service Accounts Project Collection Build
Administrators Project Collection Build Service
Accounts Project Collection Valid Users Collection Proxy Service Accounts Project Collection Test Service
Accounts
Team Project Security Groups
Project Administrators Contributors Readers Builders
And the list goes on forever
Permission Levels: Project Build Work Item Query Areas Iterations Version Control
And each has very granular permissions
Your (AD) Users and Groups
Create different AD groups for different roles
TFS has to be granular to suit every need
Do not over specify – a few groups would usually suffice
Do not lock it in: adapt as need arises
Team Portal
Team Portal
Project documents and requirements Process Guidance Dashboard with reports about
ongoing things Wiki
Some versioning goodness
Portal features you could use Announcements Contacts Discussion Boards Out of TFS Tasks Surveys ….
RSS subscriptions Alerts
Good portal usage
Environment Lists: Name, status, URLs, current release info, access details if need be
Active Risks Sprint info: sprint No., goal, start
and end dates, daily stand-up location and time, review location and time
Project Glossary Important Dates Contacts
Web Access
Web Access Features
Create/Edit Work Items and Work Item Queries
Create/Edit Areas and Iterations Read-only access to Version Control Access to Team Build A Work Item Only View (doesn't
require CAL)
Alerts
Get notified when
Your work items (or any work item) changes Or a work item is assigned to you Or a new work item is created
Build Quality Changes Or a build completes Or it fails
Anything is checked in Or there is a check-in on a specific file Or a folder Or a file extension Or when a check-in policy is overridden
A quick intro to Scrum
Scrum looks like
Scrum terminology
Documents Product backlog Sprint backlog Burndown charts
Ceremonies Sprint planning Daily standup Sprint review Sprint retrospective
Roles Product Owner ScrumMaster The Team
All that said ...
I personally think
There is no silver bullet - NEVER … and TFS is no exception A good process succeeds regardless of
tools To succeed we should
Be transparent Inspect Adapt
Get as much feedback as frequently as possible … and the tool comes next
Putting it all together
Let’s run a project!
Some useful tools
git-tfs and posh-git Team Foundation Sidekicks Team Foundation Power Tools Telerik’s TFS Project Dashboard TFS Integration Tools TFS Administration Tools
Just search for them
Thanks
Q & A
References: Concepts
TFS Permissions: http://msdn.microsoft.com/en-us/library/ms252587(v=vs.100).aspx
VS TFS Branching Guidance: http://vsarbranchingguide.codeplex.com/
Continuous Integration: http://martinfowler.com/articles/continuousIntegration.html
Feature Branching: http://martinfowler.com/bliki/FeatureBranch.html
References: Concepts
Branch By Abstraction:http://continuousdelivery.com/2011/05/make-large-scale-changes-incrementally-with-branch-by-abstraction/
Feature Toggle: http://martinfowler.com/bliki/FeatureToggle.html
Mitigate your merge issues: http://www.mehdi-khalili.com/mitigate-your-merge-issues
References: Tools
MSDeploy: http://www.hanselman.com/blog/WebDeploymentMadeAwesomeIfYoureUsingXCopyYoureDoingItWrong.aspxhttp://channel9.msdn.com/events/mix
TFSDeployer: http://tfsdeployer.codeplex.com/
TFS Sidekicks: http://www.attrice.info/cm/tfs/
App and Web Config Transformationhttp://www.mehdi-khalili.com/transform-app-config-and-web-config
References: Tools continued
Team Foundation Power Tools: http://visualstudiogallery.msdn.microsoft.com/c255a1e4-04ba-4f68-8f4e-cd473d6b971f
Telerik’s TFS project dashboard: http://www.telerik.com/agile-project-management-tools/tfs.aspx
TFS Integration Tools: http://visualstudiogallery.msdn.microsoft.com/eb77e739-c98c-4e36-9ead-fa115b27fefe
TFS Administrations Tools: http://tfsadmin.codeplex.com