Unit testing defines a written contract about the behavior of each unit.
单元测试定义一个有关每个单元的行为的书面合同。
Rewriting code alters the behavior and even the contract of code, while refactoring preserves its outward interface.
重写代码会修改代码的行为甚至合约,而重构保持对外接口不变。
One of the major benefits of Design by Contract is that it provides explicit information within the interface or class itself about expected behavior.
契约式设计的一个主要优势是,它在接口或类本身当中提供了关于预期行为的显式信息。
应用推荐