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

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.
主站蜘蛛池模板: 钦州市| 会泽县| 彰武县| 望江县| 九江县| 浦东新区| 长宁县| 治多县| 昌邑市| 宣恩县| 普安县| 湟源县| 文化| 平陆县| 大冶市| 九龙县| 鄂伦春自治旗| 凯里市| 雷波县| 潢川县| 石门县| 仁怀市| 会东县| 北流市| 苍溪县| 新化县| 枝江市| 邳州市| 唐河县| 沂南县| 固安县| 托里县| 江安县| 饶河县| 牙克石市| 准格尔旗| 延寿县| 罗定市| 泰来县| 罗源县| 津南区|