Sunday, April 15, 2007 5:42 PM
by
elandes
TDD development with Sharepoint 2007
Andrew McConnells recent blog entry on "Real SDL & TDD for SharePoint". His call for community leaders to contribut to this discussion. While I'm not necessarily a MOSS community leader, I could be considered a leader in the ASP. NET field (I'm a Microsoft MVP among other things). Having become involved heavily with Sharepoint development in the last 2 years, I do have some observations on this very topic.
My most recent project involved creating an application using MOSS as our "application framework". Using an agile almost XP approach, my group used TDD and SDL approaches that might be useful to others. I hope to write a full length article soon, but until then, let me give some practical information on how we began using TDD in your sharepoint project.
I'm assuming you are using an application that will contain web parts and perhaps events on a list. First we create objects in .NET that will contain the information of our lists. Our methods involved creating objects only for lists that will be used in a programming context. For instance, some lists that would used as lookups we did not create tests or objects for those lists. These would be lists like states or something along those lines.
Next we used a design pattern along with interfaces to allow our tests to work with both mock objects and the actual list data. For example, for a Sales application, we'd create a Customer manager class. This class would take as a parameter an interface that implements our "Data Layer". To me the data layer is either the mock object, or the class list. I need to get going now, so I'll try to write another entry explaining this in more detail. Hope this helps.