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

How does this relate to DI?

As we have seen, the ISP helps us to break down interfaces to logically separate parts, with each part providing a particular feature—a concept sometimes referred to as a role interface. By leveraging these role interfaces in our DI, our code becomes decoupled from the concrete implementation of the inputs.

Not only does this decoupling allow parts of the code to evolve separately, but it also tends to make it easier to identify test vectors. In the previous example, it's easier to scan through the inputs one at a time and consider their possible values and states. This process might result in a list of vectors like the following:

Test vectors for the value input include:

  • Happy path: Returns a valid value
  • Error path: Returns an empty value

Test vectors for the monitor input include:

  • Happy path: Does not return a done signal
  • Error path: Immediately returns a done signal
主站蜘蛛池模板: 化德县| 夹江县| 墨玉县| 太湖县| 安福县| 额济纳旗| 永康市| 松江区| 富阳市| 阿拉尔市| 吉首市| 奉新县| 普安县| 含山县| 临潭县| 衡东县| 大洼县| 拉孜县| 伊川县| 两当县| 五原县| 玉树县| 顺平县| 望城县| 海口市| 佛坪县| 阜阳市| 淳安县| 嘉善县| 洛宁县| 吴川市| 西昌市| 英德市| 陆丰市| 桐梓县| 色达县| 福清市| 长治县| 东乡族自治县| 博野县| 吉木乃县|