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

Refactoring

While all the previous steps are mandatory, this one is optional. Even though refactoring is rarely done at the end of each cycle, sooner or later it will be desired, if not mandatory. Not every implementation of a test requires refactoring. There is no rule that tells you when to refactor and when not to. The best time is as soon as one gets a feeling that the code can be rewritten in a better or more optimum way.

What constitutes a candidate for refactoring? This is a hard question to answer since it can have many answers—it's hard to understand code, the illogical location of a piece of code, duplication, names that do not clearly state a purpose, long methods, classes that do too many things, and so on. The list can go on and on. No matter what the reasons are, the most important rule is that refactoring cannot change any existing functionality.

主站蜘蛛池模板: 平山县| 行唐县| 克拉玛依市| 汶上县| 高邑县| 湘阴县| 都江堰市| 东城区| 黔南| 游戏| 姜堰市| 崇仁县| 海阳市| 东乡县| 上林县| 加查县| 常宁市| 新昌县| 花莲县| 民丰县| 铜梁县| 广宁县| 冀州市| 酒泉市| 简阳市| 沈阳市| 太原市| 托里县| 读书| 怀化市| 顺义区| 茌平县| 宁夏| 香港| 西乌| 筠连县| 乌海市| 重庆市| 屏边| 宣城市| 兴宁市|