Contract Test

原创 2005年03月03日 18:12:00

Diaspar wrote in Contract Test:
Contract Tests explain how a class should extend a superclass or implement and interface, so that I don't have to read a bunch of prose to figure out how to do that.

一直困扰我的关于如何告诉其他人正确使用我写的基类的问题,通过contract test即可以较好的解决:

Typically, a contract test case class is abstract, then I extend it and implement a creation method or two to return instances of my own implementation of the given interface. That gives me a standard battery of tests I can run to drive my implementation. It might not be perfect (I'll have n failing tests to start) but I prefer it to documentation written in prose.

So if you're delivering something you want me to extend and I need to follow more than three rules, please deliver me some contract tests.

又google了一下,找到Joe Walnes一篇相关的Blog:Design by contract: testing implementations of interfaces

Spring Cloud Contract 测试学习

  • 2017年11月07日 16:25
  • 31.3MB
  • 下载

property sales contract

  • 2011年07月01日 14:52
  • 20KB
  • 下载


*&---------------------------------------------------------------------* *& Report  ZMMF201 采购合同框...


  • 2012年12月04日 16:54
  • 1.36MB
  • 下载

Design by Contract(契约式设计)

Design by Contract是Bertrand Meyer总结的一项设计技巧 Design by Contract的核心是断言(assertion)。所谓“断言”,是指永远为真的布尔型语句,...

spring security 的contract实例

  • 2013年01月30日 10:41
  • 6.71MB
  • 下载

我对于Design by Contract的最佳实践 通往无错代码之路 欢迎砸场(玩笑)

我对于Design by Contract的最佳实践 通往无错代码之路 欢迎砸场(玩笑)   前言 在上一篇文章中,我简单介绍了契约设计(Design by Contract)的现状,还...
  • ilvu999
  • ilvu999
  • 2012年09月11日 10:30
  • 1376

property contract 1

  • 2011年07月01日 14:28
  • 13KB
  • 下载
您举报文章:Contract Test