Refactoring   dreampuf
Insight
Compare
400      UbbParser      nutshell/gksite/views_index320   Text2pic      Django:core/cache/backend/memcache24016080 0       ...
8   UbbParser    nutshell/gksite/views_index    Text2pic    Django:core/cache/backend/memcache6420    maxBlockDepth
300      UbbParser      nutshell/gksite/views_index240   Text2pic      Django:core/cache/backend/memcache18012060 0       ...
50              UbbParser              nutshell/gksite/views_index40            Text2pic              Django:core/cache/ba...
一种修改,使软件的内部结构更容易理解,在不改变软件的可见行为方式前提下使软件更容易变更…它是一种有节制的整理代码、使bug产生几率最小化的方法。           - Martin Fowler & Kent Beck
设计原则
设计原则OCP open-closed principleSRP single responsibility principleISP interface segregation principleLSP Liskov substitution...
坏味道
坏味道重复过长函数过长的参数列表散弹式修改耦合为未来着想太多低内聚
测试
测试测试自动化频繁运行保值为每一个Bug创建一个UT集中火力对付边界条件UT是昂贵的成本为测试而设计
技巧
技巧小步重构同时只做一项重构有TODO listUT
20%其他80%
文档化好样式,简单代码有意义的名称分解为原子函数描述性类型强调重要的代码提供文件头恰当的错误处理有意义的注释
沟通
Reference
Thanks!
Refactoring
Refactoring
Refactoring
Upcoming SlideShare
Loading in …5
×

Refactoring

509 views
438 views

Published on

This slide contains a number of points should be noted that in the refactoring

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
509
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
7
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Refactoring

  1. 1. Refactoring dreampuf
  2. 2. Insight
  3. 3. Compare
  4. 4. 400 UbbParser nutshell/gksite/views_index320 Text2pic Django:core/cache/backend/memcache24016080 0 SLOC
  5. 5. 8 UbbParser nutshell/gksite/views_index Text2pic Django:core/cache/backend/memcache6420 maxBlockDepth
  6. 6. 300 UbbParser nutshell/gksite/views_index240 Text2pic Django:core/cache/backend/memcache18012060 0 numBlocks
  7. 7. 50 UbbParser nutshell/gksite/views_index40 Text2pic Django:core/cache/backend/memcache3020100 DocString(%)
  8. 8. 一种修改,使软件的内部结构更容易理解,在不改变软件的可见行为方式前提下使软件更容易变更…它是一种有节制的整理代码、使bug产生几率最小化的方法。 - Martin Fowler & Kent Beck
  9. 9. 设计原则
  10. 10. 设计原则OCP open-closed principleSRP single responsibility principleISP interface segregation principleLSP Liskov substitution principleDIP dependency inversion principle
  11. 11. 坏味道
  12. 12. 坏味道重复过长函数过长的参数列表散弹式修改耦合为未来着想太多低内聚
  13. 13. 测试
  14. 14. 测试测试自动化频繁运行保值为每一个Bug创建一个UT集中火力对付边界条件UT是昂贵的成本为测试而设计
  15. 15. 技巧
  16. 16. 技巧小步重构同时只做一项重构有TODO listUT
  17. 17. 20%其他80%
  18. 18. 文档化好样式,简单代码有意义的名称分解为原子函数描述性类型强调重要的代码提供文件头恰当的错误处理有意义的注释
  19. 19. 沟通
  20. 20. Reference
  21. 21. Thanks!

×