13 July 2008
It's summertime in Seattle, and the warmth throws everything off just a little (and that's a good thing). I got a little too much sun waiting 7 hours in line at the University Village Apple Store on Friday to upgrade to an iPhone 3G (16gb model, black color)... So I'm hiding from the sun today, and catching up on work.
Tonight I wanted to take some time to share some of the work I've been doing in the Silverlight space, a list of some upcoming blog posts and technologies I'm hoping to cover, and then links to some good, current resources on Silverlight.
Earlier today I posted a few quick technical postings:
A lot of recent feedback I've heard from people around the world has helped me to plan the next set of improvements for the unit test framework. Thanks for all the suggestions and questions!
I don't have any public timelines for these right now, but do want people to know that I'm working hard to at least get prototype-quality bits prepared that I can write about.
Unit testing fx update
The test framework's source code is being updated to better conform with design guidelines that Brad and Krzysztof would approve of... this also includes implementing a few oft-requested features:
Continuous integration support
The test service for the framework enables the use of a console test runner script. As long as your integration system runs in an interactive console, you'll be able to plug in your rich Silverlight unit tests using CruiseControl.NET, Team Foundation Build, or a MSBuild task.
The console runner is implemented in Python, for a nice cross-platform and cross-browser solution that works in Windows and OS X. The script does not host Silverlight in the console, but instead actually opens and controls browser instances. This allows your tests to work with Silverlight UI elements, the browser, and even integrate your own visual verification system if you had some time to spare.
I've been prototyping a code coverage solution for Silverlight, and hope to have something figured out. Stay tuned for details, this is a tricky problem.
Extensible test harness & unit test provider
Inside the test framework for Silverlight, there's a pretty simple "unit test provider" model that makes it easy to extend or alter the system to meet your needs.
One proof-of-concept project I did was get NUnit's metadata to work within the Silverlight framework, just by creating a provider that maps NUnit metadata to generic unit test interfaces inside the Microsoft.Silverlight.Testing.dll assembly. I'll be documenting this unit test provider functionality in a future blog post.
Asynchronous testing guides
The "asynchronous" test support in the Silverlight test framework is designed to allow a test method to queue up a set of conditional, callback, and other work items that run after the method has returned.
Typically any and all test methods that use this functionality are much more than a "unit" test, but I think the capability is powerful, and it's helped our control developers get even more coverage for their work earlier in a product cycle.
Here's the quick rundown of what this is about (and in the current test framework assemblies):
The enqueue calls don't actually run in another thread like an asynchronous delegate in the full .NET Framework, but instead they manage a set of test work items in the framework. This allows the managed code stack to fully unwind, returning control to the web browser to perform other work on the same UI thread.
The framework is then instantiated again-and-again, until all of the work items have been completed on the UI thread (which your tests should not block).
This allows for tests that update the UI of the browser or Silverlight plugin, and doing some other neat things.
I'll be posting some detailed tutorials and walkthroughs on the topic later this summer. In the meantime, check out:
A lot of folks at Microsoft have been keeping busy creating excellent content:
Have a good start to the week!
Jeff Wilcox is a Principal Software Engineer at Microsoft in the Open Source Programs Office, helping Microsoft scale to 15,000+ engineers using, contributing to and releasing open source.