Archive for the ‘Agile’ Category
Wednesday, October 29th, 2008



Great panel session at PDC on the future of Unit Testing. There were some good discussions by some ‘luminaries’ in the field (Peter Provost, Daniel Cazulino and others) that really talked more about where we are today than about where we are going in the future. Some of the biggest things I took from the session.

What is a Unit Test

People still don’t understand what a Unit Test is.  There were questions on complication on testing components, testing databases, testing WCF.  It shows that we have issues around not just unit testing but around testing in general the tools for integration and acceptance test are still lacking.

As with other aspects of development we are lacking the DSL (Domain Specific Language) and tools to make this work,  Unit Testing is probably in the best place.

Mocking – For and Against

There is a big split between those that like Mock frameworks and those that dont, in fact there wasn’t really a big split.  Peter Provost doesn’t like them, they encourage bad design, they let you get away with too much – I agree with Peter on this, however you don’t have an option in lots of situations.  I do not have the ability to refactor the framework I develop on as it’s written by Microsoft and called SharePoint.  Until the frameworks are refactored we need to use mocks – most of the audiance seemed to be in this camp.

Daniel Cazulino argued the case that using a framework to do your mocking and stubbing was good, people got too hung up on the mocking when actually most people just stub out methods using the framework, much the same as you would do manually if coded the waty Peter wants.

Some Futures

Not really that far in the future,  Microsoft Research have released Pex a system to automate whitebox testing.  I can see this having real bog value in situations where you have lots of legacy (existing) code that you can’t afford to refactor/rework.

The challenges of concurrency with the preverlance of multi-core systems and the improvements in tools to make coding easier.

Wednesday, October 29th, 2008



TypeMock have recently made some updates to their site and have started to pull together information around testing SharePoint. I’m really getting to like the new AAA (Arrange, Act, Assert) approach that they are building into the product from version 5 onwards.

 Gil Zilberfeld post a great example of this by refactoring the work that was done on the SharePoint Patterns and Practices project using the (coming very soon update to TypeMock).   Although I like Natural Mocks it tended to make the tests quite long and very brittle, using the new AAA syntax this becomes so much more cleaner.

Members.ReturnRecursiveFakes seems to be where all the magic exists.    Previously you would have to write stub code for everything your method touched on the objects, which made the tests very brittle, now using the Recursive Fakes approach you only need to stub out the methods that you want to validate.

Roy Osherove manages to explain this in a very easy to understand way.

Thursday, October 16th, 2008



Going to PDC?   into Agile development?   going to be there for the Pre-conference sessions on Sunday?

You need to attend the session Agile Perspectives, Industry and Microsoft

Presenter(s): Mary Poppendieck, Grigori Melnik

Agile development is here! During this all-day agile session Mary Poppendieck, author of “Lean Software Development: An Agile Toolkit” will share profound insights that will optimize your agile processes. The session will focus on best practices and advice to avoid the most common pitfalls for teams practicing or moving towards agile. During the second half of the session, Grigori Melnik, Technical Program Manager in Microsoft Patterns & Practices team, will share the lessons learned his team has acquired over many, many agile projects. The session will close with a panel – including Mary, Grigori, and a few guest speakers – for you to ask your tough questions around agile development.

It’s a real shame that my flight doesn’t arrive until late on Sunday :(

If your going please tweet/blog/share the best bits.

Sunday, August 31st, 2008



Version One have released the results of it’s third annual State of Agile Development 2008 Survey.

The results are based on 2319 surveys representing 80 countries and gives a really useful insight into how agile development techniques are being adopted,  most notable to me was the use of Scrum, XP or a hybrid of both covering almost 80% of all agile teams.

Struggling to get agile working or adopted then you probably have issues with the organisations resistance to change and a lack of agile experience in your teams.   These issues were also identified as the key reasons for unsuccessful Agile projects.   It is worth the effort with over 55% or companies reporting 90-100% success rate.

Wednesday, August 27th, 2008



The Patterns & Practices group are looking at Guidance on SharePoint and are making regular code drops to the CodePlex project.

They have done research and the customers have ranked the requirements in order of importance.

  • Unit testing and debugging
  • Packaging and deployment
  • Setting up a team development environment
  • Unclear which SharePoint features/ components to use and when
  • Solution maintenance/upgrade
  • How and when is SharePoint Designer applicable
  • Who would have thought Unit testing and debugging would have been top of the list!

    Francis Cheung is on the P&P team for SharePoint Guidance and has posted some of the details from their work to date,  you will see a very good review of the reasons unit testing SharePoint is hard and also some explanation behind the design decisions taken in the sample project on CodePlex.   Some of the areas hi-lighted will be covered in more detail in our more advanced white papers.

    TypeMock Video

    I also spotted a little nugget comment on the post pointing to a short (9min) video on using TypeMock for SharePoint,  you have to question the TDD approach in the demo but I don’t think this is the aim.  It uses Natural Mocks and explains the difference between recording and the creation of mock objects, the use of RepeatAlways() to create a Stub and a few other simple tips.

    For those new to TypeMock there are 4 other videos that will give you more details,  we will be covering the use of TypeMock in our more advanced white papers.

    Tuesday, August 26th, 2008



    We are very pleased to announce the publication of our white paper Beginners Guide to Test Driven Web Part Development.

    This white paper forms part of our Unit Testing SharePoint Solutions – The Basics series and provides an introduction to unit testing web parts within SharePoint 2007; this is a beginner’s guide and as such does not aim to address some of the more challenging issues you will face as you develop your SharePoint solutions (we will be covering these in our future more advanced white papers) but aims to get you thinking about how to develop with testability in mind.

    We start with a common user story and walk you through the development of the functionality adopting a Test Driven approach. We introduce some of the tools and frameworks we use to help us adopt a TDD approach and look at where we feel the border between Unit and Integration testing exists.

    This white paper is based on our views and experience, we welcome your comments and suggestions and will update the white paper as the community knowledge, experience and best practice evolves.

    I would like to thank Spence Harbar and James Fisk for reviewing this paper.

    Wednesday, July 16th, 2008



    Adam Buenz is a scarily clever guy;  if your into improving your development approach and work with SharePoint you have to spare a few minutes to read and digest this.

    Quote:

    The point I am trying to drive home is implementing an SDLC is not a nice-to-have thing on any SharePoint project, it is required. And while this may be the case, it does not discount the tried and true project metric harvesting methods that have been around since the dawn of man. While producing of client deliverables is always the focus, generating valid project metrics can both help to manage your project better, as well as make sure that iteration problems that you have in one project, don’t get repeated on another.

    The Degradation of Empirical Software Development Management Techniques

    Friday, July 11th, 2008



    The SUGUK Big Event of 2008 took place last night and was a resounding success. I presented an introduction to Agile SharePoint Dev with zero code demos, which was a welcome relief to the audience as Todd Bleeker had just fried their brains with the SPD to Visual Studio workflow session. (looking forward to seeing this online). This introduction looked at what Agile means, the importance of the Empirical approach and the problems with the prescriptive process that so many organisation continue to flog. I introduced the Agile manifesto which is the foundation to the changes happening in the industry.

    The talk looked at Scrum as an example of an agile management process interwoven with some discussion on XP processes and how the two work together.

    I have uploaded the presentation here.

    Agile Sharepoint Dev (Suguk 11 July 08)

    There was a lot of really good discussion that continued in the bar afterwards, a lot of things to cover over the coming months.

    If you have any comments on what was presented, or what areas of agile SharePoint development you think are lacking on the web please post them here.

    A big thank you to Steve Smith and Nick Swan for organising a great event, to Matt Groves, Todd Bleeker, Bill English, Penny Coventry and Steve Smith for presenting.

    Hope to see you all at a future SUGUK event, the next is scheduled for 14th August in London.

    Saturday, April 14th, 2007



    Spender Harber posted a recent article “Test Driven” SharePoint Development

    …a first stab at providing some guidance for those looking to implement SDL approaches to SharePoint, and a call to action for the developer community to adopt “Test Driven” SharePoint development.

    I’m in, anyone else?

    Sunday, December 10th, 2006



    ..continued from part 3

    Section 9 Playtime – Page 139

    The last task is to add a link to each item and remove it from the cart. It is suggested that you do this in a non-Ajax way first and then add the Ajax and the example on http://wiki.pragprog.com/cgi-bin/wiki.cgi/PT-D-4 covers this in detail however I found the following problems.

    Not working in JavaScript disabled browser

    <td>

    <%= link_to_remote “remove”, :url => { :action => :remove_from_cart , :id => cart_item.product} %>

    </td>

    This line renders the link as an onclick event which will not work if javascript is disabled. This may be a bug in my version of Ruby on Rails where the href=”#” should render the link if javascript is disabled.

    <a href=”#” onclick=”new Ajax.Request(’/store/remove_from_cart/2′, {asynchronous:true, evalScripts:true}); return false;”>remove</a>

    To resolve this issue I replaced this with

    <% form_remote_tag :url => {:action => :remove_from_cart, :id => cart_item.product } do %>

        <%= submit_tag “remove” %>

    <% end %>

    This produces a form similar to the ones used for the Index.rhtml

    If using JavaScript the redirect_to_index will not work, this is because the form_remote_tag (or link_remote_tag) enable XHR request which will not force a redirect of the main browser. This should be written as form_tag (or link_tag) to work without Ajax and updated to use remote once the remove_from_cart.rjs has been created. Generally you will tend to write this in the finished format now that you know how the remote calls work.