This morning I was in a meeting with a bunch of developers and they asked me… “What is the best tool for Unit Testing SharePoint?” I talked to them about patterns and practices SharePoint (Thanks Francis Cheung, your User Group session at Puget Sound SPUG paid off.)
I then went to http://www.SharePointDevWiki.com right in the meeting to look at the list of tools and resources and found a post on SharePoint Development with Unit Testing. They were asking alternatives to WSPBuilder and I knew the spdevwiki had a comparison of solution package development tools including a killer side by side chart of WSPBuilder with STSDev and VSeWSS. The resources were extensive and the name brand resources were great! The people in the meeting had heard of the tools, but were looking for more. Next I went to SharePointReviews.com to see if any third parties had any dev/testing tools, but I didn’t see a development category. The deployment category didn’t fit. Twitter was running through my brain. It prompted me to say let me ask my twitter buddies… (even though my friends in the states were asleep.)
I posted this question to Twitter in the middle of my customer meeting and had 80% of theses responses by the end of the meeting. The customer was super impressed by the quick quality responses.
JoelOleson – @jthake what is the best unit testing tool for SharePoint?
@AndrewWoody @harbars What do you use for Unit Testing SharePoint?
andrewwoody – @joeloleson @harbars either MSTest (built in to VS) or NUnit as framework with Typemock Isolator to mock out SharePoint
zimmergren – @joeloleson @AndrewWoody I use NUnit myself, and the Resharper has some cool testing utilities to help out.
JoelOleson – @AndrewWoody Awesome. It’s nice to see TDD coming to SharePoint, but we need more. Experience with Typemock, Isolator?
JoelOleson – @zimmergren @AndrewWoody cool. Thanks for sharing. I’m filling in a customers here in Germany with this rich info.
harbars – @joeloleson @AndrewWoody NUnit is my preferred option. DevPartner also good …, MSTest is good also, lifestyle choice!
What an incredibly rich interactive world wide discussion in the course of an hour… and who knows… it may not be over!
What did I learn:
- Microsoft has a tool built into Visual Studio called MSTest as well as SharePoint TDD Patterns and Practices guidance and best practices at MSDN as well as v2 in development on http://www.codeplex.com/spg
- There’s a whitepaper for TFS on Visual Studio Team Tester for creating automated builds
- Popular TDD Tools of .NET Developers use tools such as Resharper (by Jetbrains) – a Visual Studio add in, including a beta 4.5 that’s currently available for download. And NUnit an open source C# project for Unit Testing. (Andrew Connell has written his own SharePoint baseclass for NUnit, and Spence wants to see more SPDev teams using NUnit.
- TypeMock Isolator is the new tool of choice for Andrew Woodward who has done a series of blogs on TDD and Unit testing and SharePoint.
- Compuware has a full suite called DevPartner Studio which compliments Visual Studio.
We also discussed some things I’d learned from twitter from a search on “#MIX09 and SharePoint.”
@katriendg VS2010 will have full debugging and development experience for SharePoint, yeah some people will be happy! #mix09
Snippet from SPDevwiki on SharePoint Development with Unit Testing (from Top posts) please Contribute! Thanks Jeremy Thake, @spdevwiki the Wiki Rocks!
Microsoft has published an article on Unit Testing in SharePoint as part of the SharePoint Guidance
Andrew has a great set of articles on Unit Testing in SharePoint Development including 2 excellent White Papers.
Francis discusses the approaches and also the reasons why SharePoint Unit Testing is so difficult.