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

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
主站蜘蛛池模板: 射阳县| 贵德县| 长白| 芜湖县| 龙游县| 朔州市| 育儿| 大安市| 佳木斯市| 大宁县| 长寿区| 奉新县| 吉林市| 格尔木市| 巴南区| 永嘉县| 五台县| 新兴县| 孝义市| 高州市| 建瓯市| 邢台县| 象州县| 长治县| 河南省| 伊金霍洛旗| 麻江县| 乌审旗| 新泰市| 睢宁县| 邵武市| 新野县| 万盛区| 富平县| 拜城县| 兰坪| 景泰县| 台东县| 东台市| 驻马店市| 枣阳市|