Code Coverage for Silverlight and Windows Phone

NOTE: This was cross posted from here.

As part of building my WP7 app, I spent a fair amount of time trying to get code coverage working for my unit tests. I tried a number of different approaches including using the Silverlight Unit Test Framework and NUnit + dotCover. I finally landed on an approach that worked for me using the unit testing capabilities in Visual Studio 2010. Since this is a much confused topic with very little info on the web on how to successfully get working for Silverlight/Windows Phone apps, I published a screencast on the subject.  I hope you find it useful.

Direct link:


"Code coverage is a measure used in software testing. It describes the degree to which the source code of a program has been tested."

In this screencast, you will learn how to get code coverage for your Silverlight and/or Windows Phone ViewModels through unit testing.  You can learn more about code coverage in Visual Studio 2010 from:

Get Microsoft Silverlight

Comments (1)
  1. Ravikiran says:

    Excellent  article. Exactly this what I am looking for.

    Thanks a lot for posting it.

    And my question is , Is there any way to get Code coverage for Silverlight UI Testing. I am using CodeUI Test Framework for UI testing of my Silverlight applications.

    Please guide me if there is anyway to get code coverage for Silverlight UI Testing.

Comments are closed.

Skip to main content