Say you are designing a Square root method sqrt. Do you prefer to validate the parameter passed is not a negative number or do you leave it up to the caller to make sure the param passed is valid. How ...
I am a somewhat defensive programmer and a big fan of Microsofts Code Contracts. Now I cannot always use C# and in most languages the only tool I have is assertions. So I usually end up with code ...
I'm a huge fan of writing asserts, contracts or whatever type of checks available in the language I'm using. One thing that bothers me a bit is that I'm not sure what the common practice is for ...
I recently stumbled upon Microsoft's framework for code contracts. I read a bit of documentation and found myself constantly asking: "Why would I ever want to do this, as it does not and often cannot ...
Code Exploration (CE) is quite a new term and I wonder if there already any successful examples of implementing this techniques in terms of Continuous Integration principles? In short, Code ...
What benefits does having code contracts available within the language/framework have? How does it compare to using unit tests or assertions instead?
I often find myself wondering what programming best practices apply to solo programming, since most of the time, I'm the only programmer on a project. I just started experimenting with C# 4.0 Code ...
Why must the burden of proof rest with the caller and not the method of the class that is being called?
Michael Perry states in his Pluralsight course on Provable Code (transcript subscription only) that: [T]he burden of proof rests with the caller In a code contract, why must the burden of proof ...
I have used Java Modeling Language (JML) with its runtime assertion checker jml4c for writing code contracts in java. However, it would have been great to have a static checker in place as well that ...
I'm learning about code contracts in .NET, and I'm trying to understand the idea of pure constructors. The code contracts documentation states: All methods that are called within a contract must ...