CodeContracts

Source code for the CodeContracts tools for .NET

  • 所有者: microsoft/CodeContracts
  • 平台:
  • 許可證: Other
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

CodeContracts

Join the chat at https://gitter.im/Microsoft/CodeContracts

Source code for the CodeContracts tools for .NET

Code Contracts provide a language-agnostic way to express coding assumptions in .NET programs.

The contracts take the form of pre-conditions, post-conditions, and object invariants. Contracts act as checked documentation of your external and internal APIs. The contracts are used to improve testing via runtime checking, enable static contract verification, and documentation generation. Code Contracts bring the advantages of design-by-contract programming to all .NET programming languages. We currently provide three tools:

  1. Runtime Checking. Our binary rewriter modifies a program by injecting the contracts, which are checked as part of program execution. Rewritten programs improve testability: each contract acts as an oracle, giving a test run a pass/fail indication. Automatic testing tools, such as Pex, take advantage of contracts to generate more meaningful unit tests by filtering out meaningless test arguments that don't satisfy the pre-conditions.
  2. Static Checking. Our static checker can decide if there are any contract violations without even running the program! It checks for implicit contracts, such as null dereferences and array bounds, as well as the explicit contracts.
  3. Documentation Generation. Our documentation generator augments existing XML doc files with contract information. There are also new style sheets that can be used with Sandcastle so that the generated documentation pages have contract sections.

Building from source

For working on the project, open CodeContracts.sln and build.

To create the installer and the nuget package, just run buildCC <version>.

We use the convention:

  • CC major version = 1.9.1
  • CC minor version = {month}{day}.{buildInTheDay}

For instance, the 10th build on July 16 would be run as follows:

buildCC 1.9.10716.10

主要指標

概覽
名稱與所有者microsoft/CodeContracts
主編程語言C#
編程語言C# (語言數: 16)
平台
許可證Other
所有者活动
創建於2015-01-06 19:48:32
推送於2018-10-06 09:40:22
最后一次提交2017-03-11 14:46:20
發布數5
最新版本名稱v1.10.20606.1 (發布於 )
第一版名稱v.1.9.10709.0 (發布於 )
用户参与
星數891
關注者數151
派生數153
提交數608
已啟用問題?
問題數317
打開的問題數205
拉請求數143
打開的拉請求數9
關閉的拉請求數38
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?