Welcome to MSDN Blogs Sign in | Join | Help

Just Coding

Spanish Developer Bits
Moles

I’ve been interesting in unit testing for some years now. One major aspect of unit testing is about how use designs that allows a separation of concerns so you can test your program as units (usually at class level), for this the interface basic programming is a MUST.

Once you start with interfaces, you will follow with mocks, and stubs. However, this approach has a big limitation when you want to test code that depends on static methods, typical examples are ASP.Net context or SharePoint API.

The next step forward to alleviate this limitation will be the Mole pattern where using the instrumentation capabilities of the .Net runtime we are able to “inject” code that simulate static behavior without needing an explicit interface to decouple classes.

Microsoft research is working on something called Moles, that integrated with Pex will offer a brand new way to perform unit tests.

More info: http://research.microsoft.com/en-us/projects/stubs/

Posted: Thursday, November 05, 2009 10:37 PM by rido
Filed under: , ,

Comments

No Comments

Leave a Comment

(required) 

(required) 

(optional)

(required) 

  
Enter Code Here: Required

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Page view tracker