How to Write Unit Tests

This is not an article that guides you to setup a concrete unit test example. It is about discussing the basic principles, including the motivation of writing unit tests, the concepts from popular unit testing frameworks, and the thinking on what ideal unit tests look like. It will give beginners a good foundation on learning and writing unit tests … 继续阅读


图灵停机问题问的是“能否设计一个算法,在判定任意的一段算法对给定的一些输入在有限步骤后停止运算时,返回是,而在判定任意的一段算法对给定的另外一些输入无法在有限步骤后停止运算时,返回否“。图灵的回答是这样的算法无法被设计出来。问题中所谓的算法等价于图灵机。假设存在算法A,具备这样的能力。设想对任意的算法T,对于输入mh,能够在有限步骤后停止运算,那么,此时算法A对于(T, mh)回答是。同样的算法T … 继续阅读