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

Disadvantages of TDD

Just like everything else in the world, TDD has some disadvantages. The main ones are:

  • No silver bullet: Tests help to find bugs, but they can't find bugs that you introduce in the test code and in implementation code. If you haven't understood the problem you need to solve, writing tests most probably doesn't help.
  • It seems slower at the beginning: If you start TDD, you will get the feeling that you need a longer duration of time for easy implementations. You need to think about the interfaces, write the test code, and run the tests before you can finally start writing the code.
  • All the members of a team need to do it: As TDD influences the design of code, it is recommended that either all the members of a team use TDD or no one at all. In addition to this, it's sometimes difficult to justify TDD to the management because they often have the feeling that the implementation of new features takes longer if developers write code that won't end up in the product half of the time. It helps if the whole team agrees on the importance of unit tests.
  • Tests need to be maintained when requirements change: Probably, the strongest argument against TDD is that the tests have to be maintained as the code has to. Whenever requirements change, you need to change the code and tests. But you are working with TDD. This means that you need to change the tests first and then make the tests pass. So, in reality, this disadvantage is the same as before when writing code that apparently takes a long time.
主站蜘蛛池模板: 隆德县| 龙陵县| 兰州市| 开封市| 武夷山市| 新郑市| 射阳县| 承德市| 滨州市| 大安市| 阿瓦提县| 泾阳县| 赫章县| 枝江市| 武夷山市| 根河市| 曲阳县| 仪陇县| 平阳县| 客服| 长春市| 旬邑县| 紫云| 八宿县| 大荔县| 太湖县| 台江县| 泸州市| 永清县| 商南县| 新营市| 宁河县| 阜阳市| 沂水县| 鄂托克旗| 南安市| 福清市| 扶余县| 云梦县| 遵化市| 屯留县|