More From RiSE (Research in Software Engineering)Code Contracts for .NET
Free
Code Contracts are static library methods used from any .NET program to specify the code’s behavior. Runtime checking and static checking tools are both provided for taking advantage of contracts.Description
Reviews (10)
Sign in to Write a Review
Sort By:
Absolutely excellent. I use code contracts extensively and they have added value in discovering bugs (by being "debug.assert" on steroids, and useful for static analysis), preventing bugs (by making it painless to provide brilliant documentation for you methods and types, so other devs easily know what a method/type supports and what it doesn't), and accelerating the resolution of bugs (with the rewriter turning contracts into assertions, you catch issues usually much closer to where the bug actually occurs, than where it actually starts causing damage -- like where an exception is thrown; also, so often we will know "okay, this bug is because this method doesn't handle the case where p=5 correctly. But we know must read around the code a bit because we've got no idea if this is a bug in the method and it /should/ handle p=5, or it's a bug in the caller which shouldn't ever /pass/ p=5 -- we never ask these questions with methods documented with code contracts). Excellent tool! I wish more people would know about it. I love this project. The fact that I can create contracts against an interface saves me code in multiple implementations as well as keeping changes to rules in a single place. This is the best kept secret of the .NET world - more people should use this. I absolutely love it and warmly recommend it. Nearly two years back I used it and then I think it was not in the list of extensions. That time I found it quite handy. It would be nice to see a code example or a link to more information.
| Edit
|
Sorry, we were in a hurry when we created this page. I've added a link to our website where you can find much more information. Let us know if you want to know more! Love it! :) Very helpful tool chain. |