Developed by Microsoft’s Research in Software Engineering, Code Contracts provide a way to convey code assumptions in your .NET applications. They can take the form of preconditions, postconditions, and state invariants. In C# Code Contracts Succinctly, author Dirk Strauss demonstrates how to use Code Contracts to validate logical correctness in code, how they can be integrated with abstract classes and interfaces, and even how they can be used to make writing documentation less painful.

Dirk Strauss

Dirk Strauss is a Software Developer from South Africa. With experience in VB.NET, C#.NET and SYSPRO, he currently works for Evolution Software developing responsive web applications. He loves all things Technology and is slightly addicted to Twitter and Jimi Hendrix. Apart from writing code, he also enjoys writing articles. “I love sharing knowledge and connecting with people from around the world. It’s the diversity that makes life so beautiful.”

Interests include C#, VB.NET, Technology in general & trying to master Hendrix licks on Guitar

  1. Getting Started
  2. Using Code Contracts
  3. Some Useful Tips
  4. Testing Code Contracts
  5. Code Contracts Editor Extensions
  6. Conclusion
  7. Tools and Resources