Skip to main content

Code review

程式碼審閱 (Code Review) 也稱為同儕程式碼審閱 (peer code review),是指有目的、有條理地聚集其他程式設計師,以檢查彼此的程式碼是否有錯誤。與其他技術不同,程式碼審閱可以加速並簡化軟體開發流程。同儕審閱也可以節省時間和金錢,尤其是可以捕捉到那些可能會在測試、生產和最終使用者的筆記型電腦中偷偷出現的缺陷。

Code style guides
Five tips for pull request reviews

Some of the considerations you should have with pull request reviews are:

  1. Be selective with reviewers: It's important to select a reasonable number of reviewers for a pull request. Adding too many reviewers can lead to inefficient use of resources, as too many people reviewing the same code may not be productive.

  2. Timely reviews: Ideally, reviews should be completed within two hours of the pull request being submitted. Delays in reviews can lead to context switching and hinder overall productivity. 

  3. Constructive feedback: Feedback should be constructive and explain what needs to be changed and, more importantly, why those changes are suggested. Friendly and non-accusatory language fosters a positive and collaborative atmosphere.

  4. Detailed pull request description: The pull request should include a detailed description that covers the changes made in the feature branch compared to the development branch, prerequisites, usage instructions, design changes with comparisons to mockups, and any additional notes that reviewers should be aware of. This information ensures that reviewers have a comprehensive understanding of the changes.

  5. Interactive rebasings: Interactive Rebasings allow developers to modify individual commits without cluttering the commit history with redundant or unrelated changes. Keeping commits clean and relevant contributes to a more organized and maintainable codebase.