A Start at Test Driven Development with Silverlight 2

As you likely heard, we have released the source code for all of the Silverlight controls as well as almost 2,000 of our own unit tests.  Included with in this is a jewel... A unit testing framework for Silverlight.  It is very powerful to have this feature so early in the develop of a new platform such as this.

Shawn Burke has a nice post walking you through the source code and test suite

Controls ProjectTest Projects, Controls.Data, Controls.Extended


Jeff Wilcox has a post detailing the Unit Testing framework he built for Silverlight 2


I'd love to hear what you think... Have you looked around in the source and test code base yet?  Have you tried out the unit testing framework?  any thoughts\feedback?


thanks and enjoy!

Comments (10)
  1. URL : http://blogs.msdn.com/brada/archive/2008/03/18/… Brad Abrams announced the availablility (as

  2. Jody Breshears says:

    You are THE MAN! Not so much for the control code, which is nice, but for A SILVERLIGHT TEST HARNESS!  Man, I have been dying out here waiting to get back to doing TDD!

    Is there any way you could release the source for the test harness? (Microsoft.Silverlight.Testing + whatever it needs.) That way me, and the god knows how many other TDD addicts can get started building it out.  Nothing complicated, just a simple CodePlex project (or whatever keeps legal happy.)

    Do please ask.  It would make a huge difference for me and an awful lot of others out here.  If you need ammunition, feel free to point that there are no secrets to keep.  I have already been through about half the code with Reflector.  If I have to, I’ll go ahead and disassemble it, and start work that way, as there are a couple changes I need immediately.  However, I would FAR rather work with MS’s blessing than the other way.  

    In any case, do please ask.  And thanks again for the goodies. Oh, and kudos on some very nice looking code, too.

    If for any reason you need to reach me re the source code thing, you can get me at msblogs@jodysworld.net



  3. Jody Breshears says:

    Oh, and one more thing. How did you measure your code coverage?  With Team System, or something hand rolled?

  4. JWilcox says:


    It’s good to get some reactions about the test framework from you, thanks!  That’s good feedback about the source, it’s something that I would love to see happen in my opinion.  

    We worked pretty hard on getting the binaries released so that people could really see how neat the controls are by also having those unit tests.  Now that that’s done we might be able to figure out what it will take to release the source, it definitely would be helpful to people.

    If you do take a look at the public interfaces today, there’s a lot of extensibility through log providers and other types, in the coming weeks I’ll try and blog a little about that.

    RE: Code Coverage,

    Because of the security model in Silverlight, there isn’t an easy way to get code coverage information unfortunately.

    I tried the command line coverage tools from team system and that didn’t work for me, the instrumentation only appears to work for desktop framework assemblies (but no error message appeared during instrumentation).

    I do know some folks have been "cross-compiling" their source using the desktop framework to get coverage for basic class libraries and controls that don’t use Silverlight-specific features.

    Thanks for the feedback, hope this answers some of your questions!

    Jeff Wilcox

  5. kierepka says:

    Where can I post bugs in Silverlight? Like national character support for input controls (I can’t put in these controls any combination of our Polish national characters: łoś (right alt+l, o, right alt+s)?

  6. As you likely heard, we have released the <a hr

  7. Sam Gentile says:

    SOA/Service Bus/Design Patterns/SaaS Ayende – NServiceBus Review Ayende – NServiceBus Distributor Review

  8. Microsoft has not only released the source code for the Silverlight controls, they have released almost 2,000 of their own unit tests — and a unit testing framework that works with Silverlight. More on Brad Abrams’ blog… I think this is seriously cool.

  9. URL : http://blogs.msdn.com/brada/archive/2008/03/18/… Brad Abrams announced the availablility (as

Comments are closed.

Skip to main content