Feeds:
Posts
Comments

Posts Tagged ‘Code Contracts’

Howdy people, Me again with some more information of how both Code Contracts and Pex can be used together to write expressive tests (while still specifying a (partial) specification of the code). In the course of this article wel’ll also cover Assertions and Assumptions. In order to point out only the necessary topics, let’s introduce [...]

Read Full Post »

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: [...]

Read Full Post »

Howdy, The Code Contracts User Manual holds (besides detailed information about Code Contracts’ usage, advantages and drawbacks) a few nice lists of Code Snippets that ship with the Code Contracts and will ease your life. Find below the list of available Code Snippets for the C# language, as exactly taken from the User Manual (January [...]

Read Full Post »

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: [...]

Read Full Post »

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 [...]

Read Full Post »

Follow

Get every new post delivered to your Inbox.