Lean-Agile SharePoint Development

Post on 15-Jan-2015

2.876 views 1 download

Tags:

description

 

Transcript of Lean-Agile SharePoint Development

Lean-Agile Development with SharePoint

Bill Ayers

Bill Ayers

MCM SharePoint Server 2010MCTS, MCITP, MCSD, MCAD, MCSA, MCDBA

etc.

Professional Scrum Master (PSM I)Consultant currently specialising in SharePoint

Development and Architecture for Web Content Management

Blog: www.SPDoctor.netE-mail: BillA@flosim.com

Twitter: @SPDoctor

• Lean– Kanban

• Agile– Scrum– XP

• Automated Testing and TDD

• Continuous Integration

Agenda:

• Big design up-front

• Write-only documentation

• Analysis paralysis

• Wrong product

• Over budget/time

• Project failure

What’s wrong with this picture?Requirements

Design/Arch

Coding

QA

Deployment

Maintenance

Time for Agile…

• Manufacturing in 1940s Japan• Reduce inventory (work in

progress - WIP)• Just-in-time• Counter-intuitive• Applies just as well to

software development

Lean

• Eliminate waste• Build quality in• Create knowledge• Defer commitment• Deliver fast• Respect people• Optimize the whole• Counter-intuitive

Lean Principles

• Visualizing work• Making policies explicit

(like DoD)• WIP limits• Focus on flow (rather

than goals)• Commitment to

continuous improvement• Well suited to reactive

processes

Kanban

Jeff Lasovski Used under Creative Commons

39

• Individuals and interactions over processes and tools

• Working software over comprehensive documentation

• Customer collaboration over contract negotiation

• Responding to change over following a plan

The Agile Manifesto

We are uncovering better ways of developing software by doing it and helping others do it. Through this work we have come to value:

That is, while there is value in the items on the right, we value the items on the left more.

http://agilemanifesto.org/

• Test-first development

• Pair programming

• Refactoring

• Continuous integration

• Frequent releases

• Coding standards

• Sustainable pace

Extreme Programming - XP

Roles:Product OwnerScrum MasterThe Team

ScrumDaily Scrum•What I did yesterday•What I am going to do today•Impediments

Artefacts:Product backlogSprint backlogRemaining workWorking softwareDefinition of DonePlanning board/Charts (or software)

Scrum Components

Time-boxed Events:

Sprint Planning (1-4h)

Sprint(1-4wk)

Sprint Review (1-4h)

Sprint Retrospective (1-3h)

Daily Scrum (15m)

Shopping List Story

As a team site user I want my shopping list visible on the home page So that I don’t forget

Stories and Estimation

Acceptance Criteria:

•Does a shopping list panel appear on the home page?•Does the panel show all items in the shopping list?•Are the items sorted alphabetically?

Shopping List

• To support changing requirements we require flexible emergent design and architecture

• To support changing design we need to be able to refactor and this requires automated test coverage, ideally TDD.

• To support demonstration and potential deployment at the end of each increment we require Continuous Integration.

Technical Implications

• Need up-front architecture decisions

• Complex deployment

• Difficult to unit test

SharePoint is Different

• Isolate SharePoint calls within a Repository class

• Composite design patterns e.g. MVC/MVP, with conventional mocks and stubs

• Proprietary Mocking frameworks (Typemock Isolator, JustMock, Microsoft Fakes f/w)

• Home-grown Fake SharePoint framework (!)

• SharePoint Emulators (add-on to VS2012 Ult.)

• Accept shallow integration tests (“unigration tests” or “dirty unit tests”)

Unit tests with SharePoint – the options

Code Coverage (and other dubious metrics)

Your Custom Code

SharePoint.NET

SharePoint Unmanaged Code

ASP.NET

Windows OS

SQL

TDD

write a failing test

make test pass

refactor

requirements

Demo: TDD – Shopping List Story

As a team site user I want my shopping list visible on the home page So that I don’t forget

Acceptance Criteria:

•Does a shopping list panel appear on the home page?•Does the panel show all items in the shopping list?•Are the items sorted alphabetically?

Shopping List

• Automated building and testing of merged developer code (at least daily)

• PowerShell script everything!

• New site collection on initial deployment

• Restore a base-lined content database (per release)

• Once live, maintain two environments – one for test data and one using live content database

Continuous Integration

Path to Production (DTAP Street)Developers Integration

TestUAT Production

TFS Build Server

• Build a library of PowerShell functions

• Design your functions so that they can be re-run – detect if data already exists or delete it

• Use XML file to define configuration properties for each environment

• Make sure everything is in source control!

CI Hints and Tips

• Agile is mainstream• Kanban and Scrum are popular frameworks

that can be applied to SharePoint projects• SharePoint challenges us to find new ways of

testing and deploying • Easy to explain, difficult to implement – get a

coach, if you can• Lean and Agile approach is replacing

Waterfall for most software projects for good reason – it works! (and it’s more fun)

Summary: It’s Time for Agile…

• “The Scrum Guide”, Schwaber and Sutherland (free download from scrum.org)

• “The Art of Unit Testing”, Roy Osherove• http://www.extremeprogramming.org/• “Clean Code – A Handbook of Agile Software

Craftsmanship”, Robert C Martin• Chris O’Brien http://sharepointnutsandbolts.com – series of articles

on Continuous Integration

• “Automating SharePoint 2010 with Windows PowerShell 2.0”, Gary Lapointe and Shannon Bray

• http://blogs.msdn.com/b/visualstudioalm/archive/2012/11/26/introducing-sharepoint-emulators.aspx

Recommended Reading:

Blog: www.SPDoctor.netE-mail: BillA@flosim.com

Twitter: @SPDoctor

Thank you for listening!

Bill Ayers

Lean-Agile SharePoint Development