Great panel session at PDC on the future of Unit Testing. There were some good discussions by some ‘luminaries’ in the field (Peter Provost, Daniel Cazulino and others) that really talked more about where we are today than about where we are going in the future. Some of the biggest things I took from the session.
What is a Unit Test
People still don’t understand what a Unit Test is. There were questions on complication on testing components, testing databases, testing WCF. It shows that we have issues around not just unit testing but around testing in general the tools for integration and acceptance test are still lacking.
As with other aspects of development we are lacking the DSL (Domain Specific Language) and tools to make this work, Unit Testing is probably in the best place.
Mocking - For and Against
There is a big split between those that like Mock frameworks and those that dont, in fact there wasn’t really a big split. Peter Provost doesn’t like them, they encourage bad design, they let you get away with too much - I agree with Peter on this, however you don’t have an option in lots of situations. I do not have the ability to refactor the framework I develop on as it’s written by Microsoft and called SharePoint. Until the frameworks are refactored we need to use mocks - most of the audiance seemed to be in this camp.
Daniel Cazulino argued the case that using a framework to do your mocking and stubbing was good, people got too hung up on the mocking when actually most people just stub out methods using the framework, much the same as you would do manually if coded the waty Peter wants.
Some Futures
Not really that far in the future, Microsoft Research have released Pex a system to automate whitebox testing. I can see this having real bog value in situations where you have lots of legacy (existing) code that you can’t afford to refactor/rework.
The challenges of concurrency with the preverlance of multi-core systems and the improvements in tools to make coding easier.

