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

Doing TDD the wrong way

As interesting as practicing TDD can be, it can also be wrongly done. Programmers new to TDD can sometimes write monster tests that are way too large and defeat the purpose of test brevity and being able to perform the TDD cycle quickly, leading to a waste of productive development time.

Partial adoption of the technique can also reduce the full benefit of TDD. In situations where only a few developers in a team use the technique and others don't, this will lead to fragmented code where a portion of code is tested and another portion is not, resulting in an unreliable application.

You should avoid writing tests for code that are naturally trivial or not required; for example, writing tests for object accessors. Tests should be run frequently, especially through the use of test runners, build tools, or continuous integration tools. Failing to run the tests often can lead to a situation where the true reflection of the state of the code base is not known even when changes have been made and components are probably failing.

主站蜘蛛池模板: 蛟河市| 中西区| 永寿县| 慈利县| 涟源市| 五大连池市| 沙坪坝区| 韩城市| 蕲春县| 莱西市| 泗阳县| 辛集市| 奇台县| 峨眉山市| 自治县| 南召县| 大连市| 抚顺市| 怀化市| 贡山| 当雄县| 桐城市| 正安县| 鸡西市| 黄龙县| 左权县| 华容县| 新和县| 长泰县| 巴中市| 宾川县| 白水县| 光泽县| 靖江市| 景洪市| 清水河县| 泗阳县| 西丰县| 克东县| 光泽县| 武夷山市|