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.net E-mail: BillA@flosim.com Twitter: @SPDoctor
Kanban 9 3• Visualizing work• Making policies explicit (like DoD) Jeff Lasovski Used under Creative Commons• WIP limits• Focus on flow (rather than goals)• Commitment to continuous improvement• Well suited to reactive processes
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:• Individuals and interactions over processes and tools• Working software over comprehensive documentation• Customer collaboration over contract negotiation• Responding to change over following a plan That is, while there is value in the items on the right, we value the items on the left more. http://agilemanifesto.org/
Stories and EstimationShopping ListAs a team site userI want my shopping list visible on the home pageSo that I don’t forgetAcceptance Criteria:•Doesa shopping list panel appear on thehome page?•Doesthe panel show all items in theshopping list?•Are the items sorted alphabetically?
Technical Implications• 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.
SharePoint is Different• Need up-front architecture decisions• Complex deployment• Difficult to unit test
Unit tests with SharePoint – the options• 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”)
Code Coverage (and other dubious metrics) Your Custom Code SharePoint.NET SharePoint Unmanaged Code ASP.NET SQL Windows OS
TDDrequirements make test pass write a failing test refactor
Demo: TDD – Shopping List StoryShopping ListAs a team site userI want my shopping list visible on the home pageSo that I don’t forgetAcceptance 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?
Continuous Integration• 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
Path to Production (DTAP Street)Developers Integration UAT Production TestTFS Build Server
CI Hints and Tips• 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!
Summary: It’s Time for Agile…• 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)
Recommended Reading:• “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/intr
Bill AyersLean-Agile SharePoint Development Blog: www.SPDoctor.net E-mail: BillA@flosim.com Twitter: @SPDoctor Thank you for listening!