1. 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
2. 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
3. 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
4.
5.
6.
7. 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
9. “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
…
13. A quick tour of the Administration Console
Application Tier
Team Project Collections
▪ Team Projects
▪ SharePoint portal
▪ Reporting
Build Configurations
▪ Build Controllers
▪ Build Agents
14. The basic unit of recovery
One database per collection
Benefits
Scalability: load balance
Backup and recovery
Security isolation
Information sharing
Organizational/team structure
15. The largest unit of work associated with
developing a single product or product line
Each collection can have many team projects
16. 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
18. Work Item Comparison
Agile Scrum
Bug Bug
Issue Impediment
User Story Product Backlog Item
Task Task
N/A Sprint
19. User Story vs. PBI
User Story Product Backlog Item
Title Title
Description Description
Rank Backlog Priority
Story Points Effort
Business Value Business Value
Acceptance Criteria Acceptance Criteria
24. 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)
25. Atomic check-ins
Branching and merging
Shelving
Labeling
Concurrent check-outs
Check-in policies
Association of check-ins with work items
26. 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
27. Check-out settings
Bringing VSS annoyance to TFS!!
Check-in policy
Some useful policies
And some are unnecessary and annoying
Check-in notes
29. Feature branch
Dev branch
Release branch
Hotfix branch
Integration isolation
Technology specific branch
30.
31. 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
32. “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 ;-)
33. 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
34. 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
35.
36.
37. You need to maintain workable Mainline
You want to check-in frequently
Conflicting needs
Feature branching seems like the solution
39. 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
40. 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
42. 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
43. With or without branches, please
continuously integrate back and forward
And do not forget: Mainline is the king!
From Feature Branching By Martin Fowler
44. AKA baseless merge in TFS land
Only doable through command prompt
This is not a good ideausually
And we never talked about it – alright?!
45. Offline Mode
Source History
Code Annotation
Diff tools
Comparing files
Comparing folders
Merge tools
Two way merge
Three way merge
46. This is an important part of
Continuous Integration
47. 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
48. 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, …
49.
50. 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
51. You can queue
The latest code
A shelveset
A changeset
A label
52. Test result
Broken test could break the build
Keeping a build result around
Build Log
MSBuild Log
Drop folder
Build folder
53. Get (late) notifications on builds
Desktop notification from TFS
Do not rely on it; but having it could help
56. 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
57. You need to apply database transformation
as part of your push-button deployment
Some cool tools
MigratorDotNet
DBUP
58. Different environments have different
settings
To create push-button deployment you need
to easily apply config transformations
Some cool tools
CodeAssassin.ConfigTransform
SlowCheetah
60. 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
61. 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
62. Editing multiple entries at once
Populating your backlog
63. 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
67. 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
68. 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
69. SharePoint Web Application Services
Team Foundation Administrators
Team Foundation Service Accounts
Team Foundation Valid Users
Work Item Only View Users
70. Administer shelved changes
Administer workspaces
Create a workspace
Create new projects
Delete team project
Manage process template
Manage build resources
Delete team project collection
….
71. 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
73. Permission Levels:
Project
Build
Work Item Query
Areas
Iterations
Version Control
And each has very granular permissions
74. 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
75.
76. Project documents and requirements
Process Guidance
Dashboard with reports about ongoing things
Wiki
Some versioning goodness
78. 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
79.
80. 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)
81.
82. 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
87. 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
89. 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
92. 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
93. MSDeploy:
http://www.hanselman.com/blog/WebDeploymentMadeAw
esomeIfYoureUsingXCopyYoureDoingItWrong.aspxhttp://ch
annel9.msdn.com/events/mix
TFSDeployer:
http://tfsdeployer.codeplex.com/
TFS Sidekicks:
http://www.attrice.info/cm/tfs/
App and Web Config Transformation
http://www.mehdi-khalili.com/transform-app-config-and-web-config
94. Team Foundation Power Tools:
http://visualstudiogallery.msdn.microsoft.com/c255a1e
4-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
Notas del editor
A quick tour of TFS Administration ConsoleDo not panic. We are going to go through all these
Show Team Collections in the TFS Admin consoleShow how they relate to a database eachShow how they have got their portals
Talk about differencesCMMI sucksAgile and scrum are good. Scrum is more lightweightHow to install Scrum template
Talk about differencesCMMI sucksAgile and scrum are good. Scrum is more lightweightHow to install Scrum template
Show how to create team projectsHow to setup a portal as part of the build or later
Think of it as a journal in accounting. You will not remove a journal entry. If you made a mistake you fix it by a reverse transaction entry
Do you guys know what branching is?Do you know why it is “useful”?Define branching
Discuss the benefits of each strategy/need
Explain in details
Explain how build agents can be createdExplain the benefits
But agile template is more or less the same
Create backlog itemsChange prioritiesAssign to different sprints/iterations
SharePoint PortalHow to bring it upHow to set it up if you have not as part of building a Team ProjectHow to store and retrieve documentsHow to version documents
Direct links to work items, query results, diffs, change sets and moreDisplay custom controls on work item formsView queued builds new, queue new buildsAdd new work items or edit existing onesWork with any type of work item, including custom onesAdd new work item queries or edit existing onesView, download, upload, check-in and check-out documents on SharePoint team portalView reports, export as PDF or ExcelBrowse source control repositories, download files, view changesets, diffs, histories, and annotated viewsView build results, start or stop buildsSearch for keywords in work items