Methods, Not Methodology (I): Validated Code Review

來源:互聯網
上載者:User

See Also: AntiPattern: Batch Code Review

Code review, specially daily code review, is considered a good practice. I've participated lots of code review meetings, and something concerns me. It's the low efficiency. Usually it takes longer time than scheduled, while gains less benefits than expected.

Lacking of guideline to facilitate reviewers' thinking is one of the reasons for low efficiency. All comments come randomly. The harvest really depends on reviewers' mental state, tired or energized. What kind of guideline we could use? a checklist for something? It could make things better, but today I'm going to apply the "validated learning" idea to code review.

The goals for code review are:

  • Gain knowledge for both business and technique.
  • Improve the design.
  • Try to find some bugs

So, to be able to achieve the goal, or to make sure we can achieve the goal, we could always use the following questions to validate the review. During the review meeting, for every code change, we can ask:

  • What's the domain knowledge behind of the change?
  • What's the technical knowledge behind of the change?
  • Is there any bad smell?
  • Is there any potential bug?

And yes, everybody should embed the code smell list in mind.

Use these four questions as a guideline to improve the efficiency of code review meetings. It works for me. Hope it's helpful for you.

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.