



Sans Institute, the largest information security firm in association with software and security giants including Microsoft, Symantec, McAfee, published a hot 25 programming errors under three categories:
Insecure interaction between components
Risky resource management
Porous defenses
Our responsibility is to literate these top 25 errors to your colleagues, friends and follow these guidelines during your product development.
More details about the list, visit here.




Design by contract is a popular approach to designing software. This approach prescribes the software designers should define formal verifications, specification of every components in an application. These verifications and specifications should answer the following questions:
These can be achieved by contracts or assertion which can consumed at method level. These contracts normally contains:
To use this approach in .NET, Microsoft Research Lab released “Code Contracts” for .NET.
There are three components available in this release. These are:
The first two are for runtime checking.
Contract Framework APIs
Contract.Requires() – Pre condition
Contract.Ensures() – Post condition (additional helper methods: Contract.OldValue(), Contract.Result())
Contract.Invariant() – Invariants
ContractInvariantMethodAttribute – Method level attribute, so that we can put all invariant objects into a method.
Binary Rewriter
Normal IL code for the above mentioned APIs cannot be executed at runtime. To provide runtime checking for contracts, you have to use binary rewriter which takes the IL and transforms the contracts so that contracts are executed at the exact programming points.
Get a copy of CodeContract here and user manual here.


More Options ...
Categories
Tag Cloud
Blog RSS
Comments RSS

Void « Default
Life
Earth
Wind
Water
Fire
Light 