Learn how to write better code and unit tests by using Code Contracts, Pex and Moles. Code Contracts provide 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. Moles is a light-weight mocking framework that enables detouring with delegates. See how they work together so that your code has fewer defects.