gerrit(3) | gerrit code review 产品概况

gerrit(3) | gerrit code review 产品概况

本文是对 Gerrit Code Review Product Overview 的机器翻译, 然后增加了一点个人的看法。

Gerrit Code Review 是基于 Git 版本控制的基于 Web 的代码审查工具。

Gerrit Code Review 是个啥 ?

Gerrit provides a framework you and your teams can use to review code before it becomes part of the code base. Gerrit works equally well in open source projects that limit the number of users who can approve changes (typical in open source software development) and in projects in which all contributors are trusted.

在把代码合并到 code base 之前, 你可以用 gerrit 来做 code review。 gerrit 提供了 code review 框架, 在限制可以批准更改的用户数量(在开源软件开发中很常见)的开源项目和所有贡献者都受信任的项目中同样有效。
(gerrit 很能打的; 还不会 code review 的话, 来用吧)

Code Review 是个啥 ?

Code reviews can identify mistakes before they’re found by customers. In a world of continuous integration, code must be tested before it’s submitted to the master branch to become part of the code base. Tests confirm that a product works (and continues to work) as intended by the developers.

代码审查可以在客户发现之前识别错误。在持续集成的世界中,代码必须在提交到主分支成为代码库的一部分之前进行测试。测试确认产品按照开发人员的意图正常工作(并且继续正常工作)。

(写代码不是一件很随意的事儿 – 你得有测试代码, 你的修改必须通过测试, 通过测试后才能进入 master 分支。 换言之, code is cheap, show me your testcases, show me your changes can pass testcases.)

When code is reviewed, developers:

在代码审查时,开发人员:

  1. 认真而一贯地工作 (Work carefully and consistently)

  2. 从其他开发人员那里学习最佳实践和新技术 (Learn best practices and new techniques from other developers)

  3. 在整个代码库中实现一致性和质量 (Implement consistency and quality across the code base)

Code reviews typically turn up issues related to:

代码审查通常会发现与以下问题相关:

  1. 设计:代码是否设计良好,适合代码库? (Design: Is code well-designed and suited to the code base?)

  2. 功能性:代码是否按预期执行,并对用户有益? (Functionality: Does code perform as intended and in a way that is good for users?)

  3. 复杂性:其他开发人员能否理解和使用该代码? (Complexity: Can other developers understand and use the code?)

  4. 命名:代码中的元素,如变量、类和方法是否有清晰的名称? (Naming: Does the code contain clear names for elements such as variables, classes, and methods?)

  5. 注释:注释是否具体完整? (Comments: Are comments specific and complete?)

Learn Gerrit Code Review

如果是Gerrit的新手,想要了解如何通过Gerrit来提高工作效率,请参考:

个人总结

如果写过糟糕的代码, 然后看了 Clean Code, Code Complete 这样的书, 又根据书上的指南重构了自己的代码,那么对于提到的很多 “目的” 都很清晰。

  • 6
    点赞
  • 13
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值