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

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
主站蜘蛛池模板: 水富县| 富阳市| 汉寿县| 新野县| 锡林郭勒盟| 儋州市| 淄博市| 榕江县| 霍州市| 南康市| 青铜峡市| 永嘉县| 开封市| 肃南| 广丰县| 凤翔县| 闻喜县| 繁昌县| 仪陇县| 外汇| 安福县| 天门市| 迁西县| 平原县| 敦化市| 怀仁县| 霍州市| 峨山| 楚雄市| 巧家县| 孝昌县| 杭锦后旗| 大名县| 临夏县| 镇雄县| 蚌埠市| 邯郸市| 东兰县| 科技| 江门市| 时尚|