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

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.

主站蜘蛛池模板: 广饶县| 沾化县| 金寨县| 温泉县| 宁蒗| 灵武市| 广平县| 承德市| 托里县| 理塘县| 渝北区| 鄱阳县| 波密县| 荥经县| 天长市| 大埔区| 咸丰县| 郴州市| 邢台县| 土默特左旗| 杭州市| 临洮县| 会昌县| 西林县| 体育| 巩义市| 乃东县| 荆州市| 盈江县| 新龙县| 涪陵区| 宜阳县| 宁远县| 德阳市| 定日县| 伊宁市| 黔西| 和平区| 博野县| 萨嘎县| 鹤壁市|