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

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
主站蜘蛛池模板: 崇信县| 临猗县| 武清区| 周口市| 格尔木市| 金寨县| 吉水县| 始兴县| 永德县| 射洪县| 英山县| 赣州市| 洪泽县| 尚志市| 大同市| 靖远县| 岑溪市| 烟台市| 曲沃县| 云龙县| 商水县| 噶尔县| 横峰县| 新源县| 花垣县| 蛟河市| 鄯善县| 富民县| 珲春市| 时尚| 马尔康县| 乡宁县| 桂林市| 兴和县| 内乡县| 志丹县| 翁源县| 隆尧县| 江北区| 宕昌县| 连江县|