编程小贴士

给你的编程提供小点子


为什么每个团队都需要 Code Review?

不少开发团队和创业公司都在纠结是否要执行 code review,既希望改进代码质量,又担心带来的负担会拖慢项目进度。实时上,在软件开发中质量和效率往往并不是二选其一的关系。能产出高质量代码的团队通常效率也非常高。

在我作为工程师的职业经历中,自动化测试和 code review 可说是能同时提高代码质量和开发效率的两个最有效的手段。所谓 code review,和学术界的 peer review 类似。Peer review 是由同事或同行对一位作者的作品进行查阅并提出建议和问题,只有当所有提出的问题都得到满意的答案后,作品才能发表。对于 code review 来说,作品就是代码,发表就是把代码 commit 到官方代码库。

在 Code Complete 这本书中讲述了两个很有说服力的案例。在一项对同一个团队开发的很多个程序进行对比的研究中,没有经过 review 的程序平均每 100 行有 4.5 个错误,而经过 review 的程序平均每 100 行只有 0.82 个错误,也就是说 80% 的错误在 review 中被修正了。AT & T 的一个 200 多人的部门在开始执行 code review 后,开发效率提高了 14%,而错误减少了 90% 左右。

除了减少缺陷,避免在诊断错误上浪费时间,review 的过程还可以通过相互的督促保证代码有好的可读性、文档、风格,并同时检查测试覆盖率等开发过程中的规范,从而提高团队的协作效率。对于所有复杂的事情来说,总是越早发现问题,解决问题的成本越低。

对于经验不足或者刚开始一份新工作的人来说,通过 code review 可以得到更资深的人帮助,更快熟悉现有的规范和架构,在新的环境和团队中快速提升。

对于资深的工程师来说,让其他同事 review 代码,有利于在团队中传播经验、知识和好的实践。身边的同事水平提高会让自己的工作也更高效。并且谁都有需要休假的时候,无论是公司还是个人都不希望有太 多工作因此而停滞,如果有平时就熟悉自己工作的同事,这个问题就很好解决。

像很多其他事情一样,code review 最难的就是迈出第一步。一旦开始,花在 review 过程的每一分钟都会很快被成倍地赚回来。如果你不在一个可以一下改变团队流程的位置上,那么至少可以和认同这件事的少数同事先开始实践,当价值开始体现的 时候,相信其他人会乐于效仿。

111 Responses to “ 为什么每个团队都需要 Code Review? ”

  1. i love pron说道:

    F2UfzY you make running a blog look easy. The total look of your site is great, as well as the

  2. watch movies说道:

    Look forward to checking out your web page for a second time.

  3. animal drawings说道:

    There as certainly a lot to know about this topic. I really like all of the points you have made.

  4. It is best to participate in a contest for among the finest blogs on the web. I all recommend this web site!

  5. Click to read说道:

    Very good post. I certainly appreciate this website. Keep writing!

  6. look forward to seeking more of your great post. Also, I ave shared your site in my social networks!

  7. to learn more说道:

    It as hard to come by well-informed people in this particular topic, however, you seem like you know what you are talking about! Thanks

  8. click here说道:

    I’а†ve recently started a site, the information you provide on this web site has helped me greatly. Thank you for all of your time & work.

  9. Thanks a lot for the post.Much thanks again. Much obliged.

  10. microblog说道:

    I think this is a real great article post. Much obliged.

  11. You made some decent points there. I looked on the internet for the topic and found most individuals will agree with your website.

  12. Rattling superb info can be found on blog.

  13. Green Card说道:

    Major thanks for the blog post.Really thank you! Awesome.

  14. Nwokolo说道:

    You have mentioned very interesting points ! ps decent website. I am going to a special place when I die, but I want to make sure my life is special while I am here. by Payne Stewart.

  15. klm coupon code说道:

    Thanks for sharing, this is a fantastic blog article.Really looking forward to read more. Cool.

  16. Muchos Gracias for your blog article. Want more.

  17. Thanks a lot for the article post.Really looking forward to read more. Cool.

  18. Wow, marvelous blog layout! How long have you been

  19. I was suggested this web site by way of my cousin. I am now not sure whether this post is written via him as no one else recognise such certain about my trouble. You are amazing! Thank you!|

  20. Some really superb info , Sword lily I found this.

  21. Way cool! Some extremely valid points! I appreciate you writing this write-up and the rest of the website is also really good.

  22. kien vang说道:

    Muchos Gracias for your article post.Really thank you! Great.

  23. Really appreciate you sharing this blog article.Really looking forward to read more. Much obliged.

  24. Kickboxing说道:

    Im grateful for the post.Really thank you! Cool.

  25. more enjoyable for me to come here and visit more often.

  26. This very blog is no doubt educating as well as informative. I have chosen a bunch of handy advices out of it. I ad love to go back every once in a while. Thanks a lot!

  27. Precisely what I was looking for, thanks for posting.

  28. What as up, I would like to say, I enjoyed this article. This was helpful. Keep going submitting!

  29. This blog is definitely entertaining and besides factual. I have chosen helluva helpful tips out of this source. I ad love to go back again soon. Thanks a bunch!

  30. click here说道:

    This is very interesting, You are a very skilled blogger. I ave joined your feed and look forward to seeking more of your magnificent post. Also, I ave shared your website in my social networks!

  31. Really appreciate you sharing this article.Really thank you! Keep writing.

  32. Really appreciate you sharing this article.Really looking forward to read more. Cool.

  33. Major thanks for the post.Really looking forward to read more. Cool.

  34. Thanks for sharing, this is a fantastic blog article.Really looking forward to read more.

  35. local说道:

    This is one awesome article.Really looking forward to read more. Much obliged.

  36. more说道:

    Im obliged for the blog post.Really thank you! Fantastic.

  37. School admission说道:

    Nice Site , guys! Rewarding Articles aswell. Right into my social bookmarks

  38. Im grateful for the post.Much thanks again. Will read on

  39. Really appreciate you sharing this blog post.Really looking forward to read more. Great.

  40. Major thankies for the blog post.Really thank you! Really Great.

  41. Really informative post.Thanks Again. Cool.

  42. Usually I do not learn article on blogs, however I wish to say that this write-up very pressured me to take a look at and do it! Your writing taste has been surprised me. Thanks, very great article.

  43. Im grateful for the blog.Really looking forward to read more. Much obliged.

  44. Meshack说道:

    I was recommended this web site by my cousin. I am not sure whether this post is written by him as no one else know such detailed about my difficulty. You are incredible! Thanks!

  45. This awesome blog is definitely interesting additionally diverting. I have found a bunch of interesting things out of it. I ad love to return over and over again. Cheers!

  46. Wow! Thank you! I permanently wanted to write on my website something like that. Can I include a part of your post to my blog?

  47. personal injury说道:

    There as definately a great deal to learn about this subject. I love all the points you made.

  48. This very blog is obviously entertaining as well as amusing. I have picked helluva interesting things out of this blog. I ad love to go back again and again. Thanks a lot!

  49. Bac dan SKF说道:

    This site is the greatest. You have a new fan! I can at wait for the next update, bookmarked!

  50. visit说道:

    Thanks-a-mundo for the blog post.Much thanks again. Great.

  51. There as certainly a lot to find out about this subject. I love all of the points you have made.

  52. Thanks again for the post.Thanks Again. Awesome.

  53. more info说道:

    This submit truly made my day. You can not consider simply how a lot time

  54. I’а†ve recently started a web site, the information you provide on this web site has helped me greatly. Thank you for all of your time & work.

  55. some cheap softwares some cheap softwares does not offer good online technical support so i would caution about using them`

  56. Thanks for sharing this fine article. Very inspiring! (as always, btw)

  57. wow, awesome blog.Really thank you! Awesome.

  58. I went over this website and I conceive you have a lot of wonderful information, saved to favorites (:.

  59. This particular blog is really educating additionally diverting. I have discovered helluva interesting stuff out of it. I ad love to go back again soon. Cheers!

  60. Looking around I like to browse in various places on the web, regularly I will go to Digg and follow thru

  61. Very good article. I absolutely appreciate this site. Continue the good work!

  62. I truly appreciate this article post.Much thanks again.

  63. Wow, marvelous blog layout! How long have you been blogging for? you make blogging look easy. The overall look of your website is magnificent, as well as the content!

  64. Within the event you all be able to email myself by incorporating suggestions in how you have made your website search this brilliant, I ad personally have fun right here.

  65. click说道:

    In order to develop search results ranking, SEARCH ENGINE OPTIMISATION is commonly the alternative thought to be. Having said that PAID ADVERTISING is likewise an excellent alternate.

  66. You are my inspiration , I own few web logs and occasionally run out from to brand.

  67. tham trai san说道:

    Very nice post. I just stumbled upon your blog and wanted to say that I ave truly enjoyed browsing your blog posts. In any case I all be subscribing to your feed and I hope you write again very soon!

  68. in namecard说道:

    m?rаА аЂа• details? It as very useful for

  69. dong ho seiko 5说道:

    It as nice to definitely arrive a web internet site in which the blogger is intelligent. Thanks for creating your web internet site.

  70. go there说道:

    You have made some really good points there. I looked on the net to learn more about the issue and found most individuals will go along with your views on this website.

  71. There is clearly a lot to realize about this. I suppose you made various nice points in features also.

  72. my situs说道:

    It as hard to come by experienced people in this particular topic, however, you sound like you know what you are talking about! Thanks

  73. Really enjoyed this blog.Much thanks again. Cool.

  74. my portfolio说道:

    I will make sure to bookmark your blog and will often

  75. good morning说道:

    Wow! Thank you! I continuously needed to write on my website something like that. Can I take a fragment of your post to my blog?

  76. Really appreciate you sharing this blog article.Really thank you! Keep writing.

  77. wow, awesome article.Really looking forward to read more. Awesome.

  78. some truly interesting details you have written.

  79. Say, you got a nice blog post.Thanks Again. Really Cool.

  80. pron tube说道:

    There is noticeably a bundle to know about this. I assume you made sure nice factors in features also.

  81. Game Online说道:

    It as very effortless to find out any matter on web as compared to books, as I found this paragraph at this web page.

  82. Very nice post. I definitely appreciate this website. Keep writing!

  83. That is a good tip especially to those new to the blogosphere. Simple but very precise information Thanks for sharing this one. A must read post!

  84. This site certainly has all of the information and facts I wanted about this subject and didn at know who to ask.

  85. click here说道:

    Many thanks for putting up this, I have been searching for this information and facts for any although! Your website is great.

  86. Really enjoyed this blog article.Really thank you!

  87. smile makeover说道:

    Nearly all of the opinions on this particular blog site dont make sense.

  88. These are superb food items that will assist to cleanse your enamel clean.

  89. Major thankies for the post.Thanks Again. Will read on

  90. Regards for this post, I am a big fan of this site would like to continue updated.

  91. SEO in Vancouver说道:

    Online Shop To Buy Cheap NFL NIKE Jerseys

  92. click here说道:

    Looking forward to reading more. Great blog post.Really looking forward to read more. Want more.

  93. may bo dam说道:

    Wow! This blog looks exactly like my old one! It as on a completely different subject but it has pretty much the same layout and design. Outstanding choice of colors!

  94. I think other website proprietors should take this web site as an model, very clean and great user pleasant style and design.

  95. mia pron khalifa说道:

    MoGvfK It’а†s really a great and helpful piece of information. I’а†m satisfied that you just shared this useful information with us. Please stay us informed like this. Thanks for sharing.

  96. I was suggested this blog by my cousin. I am not sure whether this post is written by him as nobody else know such detailed about my difficulty. You are wonderful! Thanks!

  97. pretty handy material, overall I consider this is worthy of a bookmark, thanks

  98. me suba说道:

    dAruO0 Thanks again for the blog post. Fantastic.

  99. Wohh just what I was searching for, appreciate it for putting up.

  100. Really enjoyed this article post.Really thank you! Fantastic.

  101. The quality of our personalized selection of fine Italian made crystal serving selection remain unchallenged.

  102. chocopie说道:

    AU75Dl It as really very complicated in this active life to listen news on Television, thus I simply use web for that purpose, and get the latest information.

  103. Thanks-a-mundo for the article post.Really looking forward to read more. Fantastic.

  104. It as a very easy on the eyes which makes it much more enjoyable for me

  105. Perfect work you have done, this internet site is really cool with great info.

  106. Usually I do not read post on blogs, however I wish to say that this write-up very compelled me to take a look at and do it! Your writing style has been surprised me. Thank you, very great post.

  107. Wow, marvelous blog layout! How long have you been blogging for? you make blogging look easy. The overall look of your site is magnificent, as well as the content!. Thanks For Your article about sex.

  108. go there说道:

    wonderful post, very informative. I wonder why the other specialists of this sector don at notice this. You must continue your writing. I am confident, you have a huge readers a base already!

  109. wow, awesome post.Thanks Again. Really Great.

  110. Woah! I am really digging the template/theme of this website. It as simple,

  111. I was suggested this blog by my cousin. I am not sure whether this post is written by him as no one else know such detailed about my problem. You are amazing! Thanks!

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>