合同包括不变量,先决条件和后置条件。
The contract includes invariants, preconditions, and post conditions.
当然,后置条件是服务端的义务。
And of course, the post-condition is an obligation for the supplier.
前置和后置条件应该是对称的。
使用断言测试方法的前置和后置条件。
Use assertions to test pre - and postconditions of a method.
函数本身可能有错,后置条件没有满足。
There is something wrong with the function; a postcondition is violated.
后置条件:执行外部组件后的预期结果。
Post-conditions: Expected results after the execution of the external component.
为封闭方法或属性指定一个后置条件协定。
Specifies a postcondition contract for the enclosing method or property.
后置条件测试通常用方法返回值的断言来表示。
Postconditions are often expressed as assertions about method return values.
透明性:前置和后置条件代码不与业务逻辑混合。
Transparency: The pre - and post-condition code isn't mixed with business logic.
条件情况很多当然,后置条件是服务端的义务。
And of course particular contract supplier, the post-condition is an obligation for the supplier.
因此,前置和后置条件是契约理论的两个基本要素。
So pre - and post conditions are two fundamental elements of contracts.
后置条件示例:新的余额就是老的余额扣除取款金额。
An example postcondition: the new balance is the old balance, less the amount withdrawn.
同样,后置条件测试大致与after建议对应。
Similarly, postcondition tests correspond roughly to after advice.
当方法结束时,后置条件表示其结果需要满足的契约。
Postconditions are contracts to be met when a methods ends, and are specified with Contract.Ensures() as in the next example
可以将断言语句作为方法的前置条件或后置条件来添加。
You can add assertion statements as the pre- or post-conditions of a method.
在活动形式中,决策条件将被捕获为输出条件的后置条件。
In activity form, you capture the decision conditions as post-conditions of the output criteria.
还有循环不变式等等,但前置、后置条件和类不变式是基本要素。
There are also loop invariants and a few others, but pre - and post-conditions and class invariants are really the basic fabric of contracts.
在软件开发里,程序员编写前置和后置条件来确立特定软件组件的角色。
In software development, the programmer writes pre - and postconditions in order to establish the role of a particular software component.
覆盖了基类方法的子类,必须保证基类方法的前置和后置条件得到检查。
Derived classes that override superclass methods must preserve the pre - and postconditions of the superclass method.
如此看来,类不变式好像是被附加到了类暴露例程的前置和后置条件上。
It's as if the class invariant is added to the pre - and post-condition of every single exported routine of the class.
这样你可以添加前提/后置条件检查输入和输出,使其健壮的人为错误。
This way you can add precondition / postcondition check for both input and output, making it robust against human errors.
然后,我填写期望的结果部分,添加后置条件,就这样一轮一轮的进行下去。
Then, I filled in the Desired outcome section, and skipped down and added a postcondition, and around and around I went.
应该接收同样的参数,返回同样类型,并且遵循同样的前置条件和后置条件。
It should take the same parameters, return the same type, and obey the same preconditions and postconditions.
后置条件测试确保组件完成操作的时候结果符合要求,假设前置条件已经满足。
Postcondition tests are guarantees that the component promises to satisfy when it completes the operation, assuming the preconditions are met.
前置条件和后置条件方法可以看到作为函数参数 (args)传递的值。
The pre-condition and post-condition methods can also see the values passed as function arguments (args).
例如,用例的前置及后置条件、输入和输出定义服务依赖关系、边界和数据要求。
For example, the pre - and post-conditions, inputs, and outputs of the use case define the service dependencies, boundary, and data requirements.
还有循环契约要素条件不变式等等,但前置、后置条件和类不变式是基本要素。
There are also loop invariants and a few others, but pre contract element condit- and post-conditions and class invariants are really the basic fabric of contracts.
后置条件通常是指方法必须正确完成工作过程,且最后将对象置于正确的状态。
To abide by the postconditions of the method, the method must correctly complete the work it was called upon to perform and it must leave the object in a consistent state.
约定规定调用者必须满足方法的前置条件,且被调用的方法执行后必须满足后置条件。
The contract states the caller must abide by the preconditions of the method and the method, in turn, must return results that satisfy the postconditions associated with that method.
约定规定调用者必须满足方法的前置条件,且被调用的方法执行后必须满足后置条件。
The contract states the caller must abide by the preconditions of the method and the method, in turn, must return results that satisfy the postconditions associated with that method.
应用推荐