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

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.

主站蜘蛛池模板: 苏尼特右旗| 县级市| 东乡| 乌拉特前旗| 海口市| 磐安县| 嘉祥县| 嘉兴市| 东丰县| 繁峙县| 鄂伦春自治旗| 高雄县| 宣威市| 金堂县| 莱州市| 新和县| 噶尔县| 嘉兴市| 吉隆县| 绥宁县| 清丰县| 临泽县| 桦南县| 丰原市| 集贤县| 监利县| 潼南县| 永昌县| 澎湖县| 金平| 汉寿县| 吴忠市| 鄱阳县| 繁昌县| 玉山县| 安图县| 奇台县| 牟定县| 凌云县| 璧山县| 溧阳市|