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

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.

主站蜘蛛池模板: 庆阳市| 任丘市| 高碑店市| 建水县| 三明市| 汉源县| 新巴尔虎右旗| 若羌县| 永嘉县| 昂仁县| 濉溪县| 水富县| 浙江省| 渭南市| 卢龙县| 灵丘县| 通州市| 龙川县| 肥东县| 合山市| 贵阳市| 紫阳县| 布尔津县| 左权县| 新密市| 林周县| 勐海县| 姜堰市| 延寿县| 辽宁省| 怀远县| 河曲县| 思南县| 遂溪县| 临清市| 绥芬河市| 西城区| 定西市| 尚志市| 贺兰县| 江都市|