Application Lifecycle Management with TFS

94
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

description

 

Transcript of Application Lifecycle Management with TFS

Page 1: Application Lifecycle Management with TFS

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

Page 2: Application Lifecycle Management with TFS

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

Page 3: Application Lifecycle Management with TFS

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

Page 4: Application Lifecycle Management with TFS

TFS Ecosystem

Page 5: Application Lifecycle Management with TFS

TFS Components: a high level look

Page 6: Application Lifecycle Management with TFS

A closer look

Page 7: Application Lifecycle Management with TFS

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

Page 8: Application Lifecycle Management with TFS

ALM

What is it?

Page 9: Application Lifecycle Management with TFS

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 …

Page 10: Application Lifecycle Management with TFS

ALM tools

Build management Release/deployment Testing Requirements management Work item management Project management Change management Configuration management ….

Page 11: Application Lifecycle Management with TFS

ALM with TFS

The most integrated ALM solution in .Net land

Page 12: Application Lifecycle Management with TFS

ALM with TFS

Page 13: Application Lifecycle Management 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

Page 14: Application Lifecycle Management with TFS

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

Page 15: Application Lifecycle Management with TFS

Team Project

The largest unit of work associated with developing a single product or product line

Each collection can have many team projects

Page 16: Application Lifecycle Management with TFS

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

Page 17: Application Lifecycle Management with TFS

Team Project Templates

CMMI Agile Scrum

Page 18: Application Lifecycle Management with TFS

Agile vs. Scrum Templates

Work Item Comparison

Agile Scrum

Bug Bug

Issue Impediment

User Story Product Backlog Item

Task Task

N/A Sprint

Page 19: Application Lifecycle Management with TFS

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

Page 20: Application Lifecycle Management with TFS

Let’s create a Team Project (Demo)

Off to Team Explorer

Page 21: Application Lifecycle Management with TFS

Customizing Templates (Demo)

Customize a project’s template Customize Project Template

Page 22: Application Lifecycle Management with TFS

TFS Services

Page 23: Application Lifecycle Management with TFS

Version Control (System)

AKA Source Control Management

Page 24: Application Lifecycle Management with TFS

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)

Page 25: Application Lifecycle Management with TFS

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

Page 26: Application Lifecycle Management with TFS

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

Page 27: Application Lifecycle Management with TFS

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

Page 28: Application Lifecycle Management with TFS

Branching

The Dark Side of

Version Control!

Page 29: Application Lifecycle Management with TFS

Branching (perceived) needs

Feature branch Dev branch Release branch Hotfix branch

Integration isolation Technology specific branch

Page 30: Application Lifecycle Management with TFS

A branching sample

Page 31: Application Lifecycle Management with TFS

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

Page 32: Application Lifecycle Management with TFS

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 ;-)

Page 33: Application Lifecycle Management with TFS

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

Page 34: Application Lifecycle Management with TFS

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

Page 35: Application Lifecycle Management with TFS

Or you will get this if you are very lucky

Page 36: Application Lifecycle Management with TFS

Or this if you are not so lucky

Page 37: Application Lifecycle Management with TFS

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

Page 38: Application Lifecycle Management with TFS

But feature branching is painful

From Feature Branching By Martin Fowler

Page 39: Application Lifecycle Management with TFS

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

Page 40: Application Lifecycle Management with TFS

… 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

Page 41: Application Lifecycle Management with TFS

Continuous Integration

The relief we are after

Page 42: Application Lifecycle Management with TFS

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

Page 43: Application Lifecycle Management with TFS

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

Page 44: Application Lifecycle Management with TFS

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?!

Page 45: Application Lifecycle Management with TFS

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

Page 46: Application Lifecycle Management with TFS

Build Automation

This is an important part of Continuous Integration

Page 47: Application Lifecycle Management with TFS

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

Page 48: Application Lifecycle Management with TFS

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, …

Page 49: Application Lifecycle Management with TFS

Build Controller and Agents (Demo)

Page 50: Application Lifecycle Management with TFS

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

Page 51: Application Lifecycle Management with TFS

Queuing a build (Demo)

You can queue The latest code A shelveset A changeset A label

Page 52: Application Lifecycle Management with TFS

Build Results (Demo)

Test result Broken test could break the build Keeping a build result around Build Log MSBuild Log Drop folder Build folder

Page 53: Application Lifecycle Management with TFS

TFS Build Notifications (Demo)

Get (late) notifications on builds Desktop notification from TFS Do not rely on it; but having it could

help

Page 54: Application Lifecycle Management with TFS

Continuous Delivery:what it all boils down to

Remember Chrome and Flickr

If you want to win you should do the same

Page 55: Application Lifecycle Management with TFS

Keep it flowing

Continuous

Integration

Continuous Testing

Continuous Delivery

Short Feedback

Cycle

Happy Customer

Page 56: Application Lifecycle Management with TFS

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

Page 57: Application Lifecycle Management with TFS

Database Migration

You need to apply database transformation as part of your push-button deployment

Some cool tools MigratorDotNet DBUP

Page 58: Application Lifecycle Management with TFS

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

Page 59: Application Lifecycle Management with TFS

Work Item Tracking in TFS

No CMMI Please!

Page 60: Application Lifecycle Management with TFS

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

Page 61: Application Lifecycle Management with TFS

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

Page 62: Application Lifecycle Management with TFS

Work Item Excel Integration (Demo)

Editing multiple entries at once Populating your backlog

Page 63: Application Lifecycle Management with TFS

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

Page 64: Application Lifecycle Management with TFS

A quick word on prioritization

Page 65: Application Lifecycle Management with TFS

Kano model helps too

Customer Preferences Attractive One-Dimensional Must-Be Indifferent Reverse

Page 66: Application Lifecycle Management with TFS

Security in TFS

Page 67: Application Lifecycle Management with 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

Page 68: Application Lifecycle Management with TFS

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

Page 69: Application Lifecycle Management with TFS

Server Level Security Groups

SharePoint Web Application Services Team Foundation Administrators Team Foundation Service Accounts Team Foundation Valid Users Work Item Only View Users

Page 70: Application Lifecycle Management with TFS

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 ….

Page 71: Application Lifecycle Management with TFS

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

Page 72: Application Lifecycle Management with TFS

Team Project Security Groups

Project Administrators Contributors Readers Builders

Page 73: Application Lifecycle Management with TFS

And the list goes on forever

Permission Levels: Project Build Work Item Query Areas Iterations Version Control

And each has very granular permissions

Page 74: Application Lifecycle Management with TFS

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

Page 75: Application Lifecycle Management with TFS

Team Portal

Page 76: Application Lifecycle Management with TFS

Team Portal

Project documents and requirements Process Guidance Dashboard with reports about

ongoing things Wiki

Some versioning goodness

Page 77: Application Lifecycle Management with TFS

Portal features you could use Announcements Contacts Discussion Boards Out of TFS Tasks Surveys ….

RSS subscriptions Alerts

Page 78: Application Lifecycle Management with TFS

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

Page 79: Application Lifecycle Management with TFS

Web Access

Page 80: Application Lifecycle Management with TFS

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)

Page 81: Application Lifecycle Management with TFS

Alerts

Page 82: Application Lifecycle Management with TFS

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

Page 83: Application Lifecycle Management with TFS

A quick intro to Scrum

Page 84: Application Lifecycle Management with TFS

Scrum looks like

Page 85: Application Lifecycle Management with TFS

Scrum terminology

Documents Product backlog Sprint backlog Burndown charts

Ceremonies Sprint planning Daily standup Sprint review Sprint retrospective

Roles Product Owner ScrumMaster The Team

Page 86: Application Lifecycle Management with TFS

All that said ...

Page 87: Application Lifecycle Management with TFS

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

Page 88: Application Lifecycle Management with TFS

Putting it all together

Let’s run a project!

Page 89: Application Lifecycle Management with TFS

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

Page 90: Application Lifecycle Management with TFS

Thanks

Q & A

Page 91: Application Lifecycle Management with TFS

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

Page 94: Application Lifecycle Management with TFS

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