Intro to fluency with TDD

Info

Breakout Session :: 300 (Advanced) :: Developer Practices

“In this demo-filled session, you’ll learn the why, what, where, when and how of working with test-driven development using the tools provided in Visual Studio 2010. In addition to seeing ‘testing-in-action’, you’ll learn about when to use what kind of test. You’ll learn both about using TDD with new code and in legacy situations. Code better and discover features in Visual Studio, such as code coverage and more that will help you to be more productive.”

Highlights

The session centered around fluency in TDD, and the requirement to keep your test code of production quality (i.e. refactor where necessary, etc.) – it also introduced the “Approvals” library, as an alternative to having to assert very granular bits of state.

The testing cycle suggested is: Whiteboard (Requirement), English (Translation), Code (Implementation), Test (Regression) and Result (Verification) and aims to promote the notion of “Intentional Code”.

Links

Using Tests to drive the entire SDLC

Info

Breakout Session :: 300 (Advanced) :: Developer Practices

“Given that you want to deliver high quality code, when you drive your entire software development lifecycle with tests – you will dramatically improve overall quality. Microsoft’s introduction of Visual Studio 2010 and Microsoft Test Manager provides very powerful tools we can use to begin with tests. In this presentation we specify an entire system with tests. We begin with tests to ensure the business value of an application is testable and we know when we’re done. Using those tests, we clarify the requirements using acceptance criteria expressed as test cases. Finally, we decompose the requirements to specific testable behaviours that will drive our unit tests. Armed with the complete understanding of the application, we begin to work upwards again. We automate the unit tests to ensure our code is tested. Then, as our code begins to take shape, we automate the functional tests to ensure our requirements are met – and stay met as our code continues to evolve. Finally, we automate the system and integration tests to prove to our customers that we have met the end-to-end vision of the application. The final demonstration shows the integration of all tests running during an automated nightly build.”

Video

Async Calls in Silverlight and WPF Clients

Info

Breakout Session :: 400 (Expert) :: Developer Tools, Languages and Frameworks

“Whenever doing blocking tasks, particularly service calls in a Silverlight or Windows Presentation Foundation (WPF) client, you will need to make those calls asynchronously. While async calls have been around for a long time in Microsoft .NET, the patterns for addressing them have been changing and improving. This session covers several common patterns for addressing async calls in client applications, including new and emerging approaches to async patterns such as Reactive Extensions that let you treat asynchronous execution like a LINQ collection and the Task-based Async pattern and keywords coming for the C# and VB languages. This session takes the mystery and confusion out of what happens and when — and how to keep your code clean and safe in an inherently asynchronous client world.”

Video

Highlights

This session provided a practical overview of asynchrony from the perspective of the UI (and by extension the affinity that UI objects and ObservableCollection<T> has with the UI thread). Some rule-of-thumb tips are:

  • Never block the UI thread. If it takes longer than 50-60ms, async it.
  • Never access UI objects from a non-UI thread.
  • Don’t access variables from multiple threads with protection.

The asynchronous patterns provided by the .Net Framework are:

  • Begin/End Async Pattern
  • Async/Completed Pattern
  • Task Parallel Library (Task<T>)
  • Task-based Async (async and await keywords)
  • Reactive Extensions (LINQ + Observables + Schedulers)

Links