开始看这本书:The Art of Unit Testing With Examples in .NET。选择它,两个原因:
- 单元测试是保证代码质量的基石和安全网。
- 该书篇幅短小精湛,而且非常实用。非常期待看到Chapter 8中的Tough Questions and Answers,其中有对如下问题的回答。
-
- How much time will this add to the current process?
- Will my QA job be at risk because of this?
- How do we know this is actually working?
- Is there proof that unit testing helps?
- Why is the QA department still finding bugs?
- We have lots of code without tests: where do we start?
- We work in several languages: is unit testing feasible?
- What if we develop a combination of software and hardware?
- How can we know we don’t have bugs in our tests?
- My debugger shows that my code works: why do I need tests?
- Must we do TDD-style coding?
如果能够顺利回答这些问题,相信unit test的实施就不是问题了。