官术网_书友最值得收藏!

Chapter 1. Exploring Test Doubles

"I never make stupid mistakes. Only very, very clever ones."

–John Peel

It is very difficult to find stupid mistakes, but it's even more daunting when you are trying to figure out the clever ones. Debugging an application to know how to fix a problem is very expensive and time-consuming. Automated unit tests provide an extremely effective mechanism for catching regressions, especially when combined with test-driven development; it creates a test safety net for the developers.

This chapter covers the concepts of unit testing, quality of unit tests, external dependencies, and test doubles.

The Working with unit tests section introduces you to test automation and describes the characteristics of a good unit test.

The Understanding test doubles section explores the concept of external dependency and provides examples of test doubles. The following test doubles are explored:

  • Dummy objects
  • Stubs
  • Spies
  • Mock objects
  • Fake objects
主站蜘蛛池模板: 玛纳斯县| 南乐县| 绵竹市| 双峰县| 巴东县| 定边县| 白朗县| 通州区| 靖远县| 静宁县| 略阳县| 伊吾县| 淮阳县| 偏关县| 永德县| 乐昌市| 红桥区| 项城市| 华亭县| 长丰县| 兰坪| 城固县| 通化县| 南涧| 舞阳县| 大港区| 芦山县| 邢台县| 开封县| 寿光市| 晋州市| 富宁县| 图木舒克市| 客服| 库车县| 永新县| 织金县| 綦江县| 安多县| 保靖县| 全椒县|