Visual Studio 2012 / .NET 4.5

W04 Design for Testability: Mocks, Stubs, Refactoring, and User Interfaces

05/15/2013

9:15AM - 10:30AM

Level: Intermediate to Advanced

Benjamin Day

Consultant & Trainer

Benjamin Day Consulting, Inc.

In this session, Ben will start by clarifying the difference between unit and integrationtests. After that, he'll demonstrate how using dependency injection, mocks objects and stubs can help break dependencies and simplify your tests.

You're sold on unit testing. You're even doing "test first" development, but there are always those nagging questions. How do your user interfaces fit into your testing plan? Do I have to call my database in order to have a good, solid test? What about calls into separate sub-systems or calls out to web services? Do you really need to have all those pieces running in order to test your logic? Are my UI tests the same for WPF, Windows Forms, Windows Phone, Win RT, and ASP.NET? What do I do about that app that doesn't have any tests?

In this session, Ben will start by clarifying the difference between unit and integrationtests. After that, he'll demonstrate how using dependency injection, mocks objects and stubs can help break dependencies and simplify your tests. Throughout the talk, you can expect to hear a lot about design patterns, how much code coverage is enough, and the fine line between too much and too little object mocking.

You will learn:

  • Beyond the basics of unit testing
  • Visual Studio 2012 Mocks & Fakes Framework
  • Model-View-Controller and 's variations (MVC, MVP, MVVM)
  • The Repository & Adapter Patterns