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

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
主站蜘蛛池模板: 兖州市| 雷波县| 来凤县| 江安县| 新兴县| 凤阳县| 陇南市| 神木县| 定西市| 平江县| 南开区| 禹城市| 无极县| 桦川县| 噶尔县| 临漳县| 利川市| 长顺县| 连江县| 长寿区| 白朗县| 新晃| 封丘县| 百色市| 正安县| 曲靖市| 盐城市| 云梦县| 都江堰市| 兴海县| 景泰县| 阳高县| 迁安市| 三台县| 宿州市| 洪泽县| 家居| 军事| 陆良县| 宜昌市| 通化县|