前言 在Visual Studio 2012 中,针对Unit Test 的部分,有一个重要的变动: 原本针对「测试对象非public 的部分」,开发人员可通过Visual Studio 2010 自动产生的accessor 来进行测试.但在Visual Studio 2012 中,将此功能移除了. Accessor 其背后的原理,是将对象通过很「脏」的反射方式,把对象内所有的东西public 出来.并且Visual Studio 在更新对象后,进行与设计测试时,会帮你做同步产生acce…
http://product.china-pub.com/199003 测试驱动的嵌入式C语言开发 Test Driven Development for Embedded C <测试驱动的嵌入式c语言开发>深入介绍如何把测试驱动的开发方法应用于嵌入式c语言开发,第一部分介绍了两个开源的测试框架,通过测试驱动开发方法开发第一个模块:第二部分深入介绍了与系统中其他模块进行交互的代码的测试技术,如测试替身.仿制对象等:第三部分介绍了设计与持续改进代码,如写出更好代码的一些重要原则,建立可测并灵活设…
3.1 依赖倒置原则的定义 依赖倒置原则(Dependence Inversion Principle,简称DIP)这个名字看着有点别扭,“依赖”还“倒置”,这到底是什么意思?依赖倒置原则的原始定义是:High level modules should not depend upon low level modules. Both should depend upon abstractions. Abstractions should not depend upon details. Detai…
依赖倒置原则(Dependence Inversion Principle,DIP)这个名字看着有点别扭,“依赖”还“倒置”,这到底是什么意思?依赖倒置原则的原始定义是 High level modules should not depend upon low level modules.Both should depend upon abstractions.Abstractions should not depend upon details.Details should depend up…