Code Contracts and Pex, introduced at Devlabs, now have even more ways to improve your .NET code. Code Contracts provides a set of tools for design-by-contract programming. Pex is an advanced unit-testing tool that uses automated program exploration to intelligently create unit tests with high code coverage. They work together so that your code has fewer defects. New features for Code Contracts include automatic documentation generation, call-site checking for components and reference assemblies for the Microsoft .NET Framework. Pex now comes with a light-weight mocking framework, improved support for large code bases, and more thorough test input generation.
For more information, check out this course on Microsoft Virtual Academy: