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

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.

主站蜘蛛池模板: 湘潭市| 黄骅市| 敦煌市| 富源县| 长治县| 东山县| 彭水| 嘉善县| 华宁县| 靖西县| 靖远县| 开原市| 无棣县| 安溪县| 长泰县| 永泰县| 诸暨市| 公主岭市| 莱西市| 海阳市| 章丘市| 望江县| 临汾市| 蚌埠市| 姜堰市| 榆社县| 泽普县| 定日县| 广元市| 沙雅县| 资阳市| 济南市| 札达县| 育儿| 惠来县| 塔城市| 邵阳县| 新竹市| 屏南县| 紫阳县| 白城市|