We can rely on informal documentation to specify such invariants, but the more invariants we can formalize and check, the better.
我们可以依靠非正式文件来规定这类不变量,我们标准化和检查的不变量越多,效果就越好。
As you'll soon see, Contract4J has the added feature of enforceable usage constraints, which is a considerable advantage over the informal documentation that is implicit in JUnit tests.
很快就会看到,Contract 4 J添加了强迫使用约束的特性,这比Junit测试中隐式的非正式文档有相当大的优势。
应用推荐