Design by Contract for C#

Software

If the propeller on your beanie has slowed down and you need a little geekifying, try checking out Spec#. It’s an extension of C# that supports Design by Contract (or Programming by Contract for the litigious). You know — preconditions, postconditions, invariants, side effects.

For alternative views into DbC for C#, you might check out XC#, although it looks like it might be abandonware. Plus they use that weird “my word has an X in it so I’ll use that in the acronym” thing.

My own take: Spec# looks forbiddingly complex. I personally believe spending the extra time writing unit tests would not only wed the code to the contract(s), but also helps iteratively flesh out the design (”design a little, code a little“), which to my mind is just as beneficial.

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Furl
  • Ma.gnolia
  • Reddit
  • TwitThis
No Comments

Leave a Reply

Allowed tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">