Navigate Up
Sign In
Supporters of Developer
Web

SharePoint Development with Unit Testing

Item is currently unrated. Press SHIFT+ENTER to rate this item.1 star selected. Press SHIFT+ENTER to submit. Press TAB to increase rating. Press SHIFT+ESCAPE to leave rating submit mode.2 stars selected. Press SHIFT+ENTER to submit. Press TAB to increase rating. Press SHIFT+TAB to decrease rating. Press SHIFT+ESCAPE to leave rating submit mode.3 stars selected. Press SHIFT+ENTER to submit. Press TAB to increase rating. Press SHIFT+TAB to decrease rating. Press SHIFT+ESCAPE to leave rating submit mode.4 stars selected. Press SHIFT+ENTER to submit. Press TAB to increase rating. Press SHIFT+TAB to decrease rating. Press SHIFT+ESCAPE to leave rating submit mode.5 stars selected. Press SHIFT+ENTER to submit. Press SHIFT+TAB to decrease rating. Press SHIFT+ESCAPE to leave rating submit mode.
SharePoint Development with Unit Testing

"unit testing is a method of testing that verifies the individual units of source code are working properly. A unit is the smallest testable part of an application. In procedural programming a unit may be an individual program, function, procedure, etc., while in object-oriented programming, the smallest unit is a method, which may belong to a base/super class, abstract class or derived/child class"
Wikipedia - Unit Testing

 In SharePoint Development, Unit Tests are hard to build due to the large number of dependencies on SharePoint Development in general.

There are multiple approaches to introducing Unit Testing into SharePoint Development:

Pros and Cons of Unit Testing in SharePoint Development

Pros Cons
Encourages TDD development Lots of plumbing - More code and complex project structures
You know when something breaks in an intricate system Negative and Positive - how far to go with this is hard to define e.g tests for invalid urls
Communicates funcionality in team development People only test code they know works
  People tend to use it as integration test rather than discrete unit tests

Getting Started with SharePoint Unit Testing

Prerequisites

Setup

What can be tested?

SharePoint Development with Unit Testing webcast


View in Browser

The SharePoint community has currently moved toward Test Driven Development but below are some useful links regarding Unit Testing in general.

Other approaches

sporm

sporm is a CodePlex project that has appeared in Alpha as of Aug 09. It takes the approach of building an ORM across a site collection which you consume rather than the API directly.

Traditionally SharePoint projects are hard to unit test, use weak typing, and require complicated XML to query for data. Sporm (TM) is specifically designed to simplify unit testing, enable strongly typed objects, and support LINQ access to SharePoint objects.
Benefits

  • Simplifies unit testing - by hiding unmockable objects like SPWeb and SPListItem
  • Enables strongly typed code - by generating classes and properties for lists and content types
  • Eliminates the need for ugly loosly typed CAML queries - by acting as a LINQ provider to your lists

External References

Categories:
No categories were selected

Comments

StewartNewman

SharePoint Developer

To be a qualified SharePoint developer, I like to share my know-how with other coders by social networking sites. I talk about my write-ups in a number of online IT newspapers, and article web sites.

Posted 03-Nov-2012 by StewartNewman
Xandra Holder

SharePoint Development

In SharePoint 2003 that is where the actual Web Part structure was included and at that time the Web Areas were SharePoint particular Web Areas.

Posted 04-Nov-2012 by Xandra Holder
Wallace Middleton

Sharepoint Development

I use Hootsuite with some look for programs. It seems the group are using different hashtags #SharePoint2013, #SP2013, #officePreview.

Posted 20-Nov-2012 by Wallace Middleton

Notify me of comments to this article

E-mail:
   

Add Comment

Title:

 
Comment:
Email:

   


Name:

 
Url: