Your SlideShare is downloading. ×
  • Like
Refactoring
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Now you can save presentations on your phone or tablet

Available for both IPhone and Android

Text the download link to your phone

Standard text messaging rates apply
Published

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

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

Published in Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
361
On SlideShare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
6
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

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