Take the 2-minute tour ×

What is Spec# I've been hearing about?

share|improve this question

6 Answers 6

Spec# is programming language that is essential an extension to C#. It adds the ability to define contracts on methods. Contacts are conditions that must be true for the method to be valid. An example of a contact would be stating that a specific parameter must not be null when the method is run.

It includes a tool that can be run that attempts to prove if the conditions are guaranteed to be met.

It was a research project by Microsoft that has now been abandoned, but the work that was done forms the basis of the code contracts in .net 4.0.

Spec# on wikipedia

share|improve this answer


More in Spec#

share|improve this answer
Great description –  Matthew Whited Aug 6 '09 at 20:36
It should be. It's a cut and paste from the posted link. –  Robert Harvey Aug 6 '09 at 20:37
I figured as much... but that doesn't stop it from be a great description –  Matthew Whited Aug 6 '09 at 21:02

Check out Microsoft's site on the language http://research.microsoft.com/en-us/projects/specsharp/

share|improve this answer

Here is the Microsoft Research page outlining the project.

From the site:


share|improve this answer

Spec# is a research language involving Design by Contract.

Note that Microsoft has chosen to integrate Code Contracts into the upcoming .NET Framework 4.0 Release. More info:


share|improve this answer

It's been abandoned.


share|improve this answer
While this maybe true... it doesn't really answer the question. –  Matthew Whited Aug 6 '09 at 20:37
I felt it was relevant information. /shrug –  Spencer Ruport Aug 6 '09 at 20:48

Your Answer


