Howdy all, Here comes another post about Code Contracts. Remember my post First Steps with Code Contracts? Let’s just recall which class we have been working on last time: 1: namespace Vehicles 2: { 3: class Car : IVehicle 4: { 5: string name; 6: int speed; 7: 8: public Car(string name, int speed) 9: [...]
Posts Tagged ‘Design by Contract’
Code Contracts: Static Checker ignores Objects Invariant for Same Type Parameter
Posted in Automation, c#, Code Contracts, Unit testing, visual studio, tagged assumption, Code Contracts, Design by Contract, ignore, ms_feeds, object invariant, postcondition, static checker, warning, windows7, workaround on January 25, 2010 | Leave a Comment »
Code Contracts on Interfaces
Posted in Uncategorized, tagged Code Contracts, Design by Contract, interfaces, ms_feeds, precondition, visual studio, windows7 on January 22, 2010 | Leave a Comment »
Hello all, This time we’ll do a quick exploration of how we can apply Code Contracts to interfaces. As you know from our post First Steps with Code Contracts, the preconditions and postconditions (Contract.Requires and Contract.Ensures calls, respectively) must be placed inside a method body. Therefore, when defining an interface, we run into a problem: [...]
First Steps with Code Contracts
Posted in Automation, c#, Code Contracts, Unit testing, tagged Assertions, Code Contracts, Design by Contract, ms_feeds, postcondition, precondition, Tools, Visual Studio 2010, windows7 on January 21, 2010 | 4 Comments »
Hello all, Today we are going to talk about another exciting project from the Microsoft Research Labs: Code Contracts. It is a Design-By-Contract (DbC) system, that enables us as developers to formulate the expected behaviour of our code by directly putting it into the code. The main tools of applying Code Contracts are: Static checking [...]

