Software-Testing-Intro
  • 简介
  • 第零章-写在前面
    • 为什么是这本书?
    • 来源与版权信息
  • 第一章-软件测试简介
    • 走进软件测试
    • 软件测试的基本概念
    • 你将收获到的东西
  • 第二章-基础(1)黑盒白盒测试
    • 白盒静态-代码审查
    • 白盒动态-结构覆盖
    • 黑盒测试
  • 第三章-基础(2)软件开发过程中的测试方法
    • 单元-集成-系统测试
    • 冒烟-回归-Alpha-Beta测试
  • 第四章-基础(3)软件特性方面的测试方法
    • 软件运行效率测试
    • 软件可靠性与安全性的测试
    • 软件用户友好性的测试
  • 第五章-进阶(1)特殊软件测试方法
  • 番外篇-也谈兼容性测试
由 GitBook 提供支持
在本页
  • 过程
  • 目的
  • 地点与方式
  • 我们对Code Review期待什么?
  • 代码审查的一些原则

这有帮助吗?

  1. 第二章-基础(1)黑盒白盒测试

白盒静态-代码审查

上一页第二章-基础(1)黑盒白盒测试下一页白盒动态-结构覆盖

最后更新于4年前

这有帮助吗?

A code review is a process where someone other than the authors of a piece of code examines that code.

过程

一个简单的代码审查过程如下:

  1. 代码作者提交初始代码给审核者

  2. 审核者审核后将comments和代码交还给代码作者

  3. 不断反复上述过程,直到审核者同意将代码提交到团队的代码库

  4. 作者将最终代码提交到团队代码库

目的

  • Find faults

  • Ensure code meets standards, and understandable (improve quality, as the code will be reviewed by others)

  • Share knowledge

    • 促进新老员工之间,或者同级但领域不同的员工之间的交流

  • Collaborate on design and problem-solving

地点与方式

  • Showing code to a colleague at a computer (pairing, remote)

  • Mob reviewing in a conference room

  • Code review software

  • Checking out a commit or branch

我们对Code Review期待什么?

  • Design: Is the code well-designed and appropriate for your system?

  • unctionality: Does the code behave as the author likely intended? Is the way the code behaves good for its users?

  • Complexity: Could the code be made simpler? Would another developer be able to easily understand and use this code when they come across it in the future? (avoid over-engineering)

  • Tests: Does the code have correct and well-designed

  • Naming: Did the developer choose clear names for variables, classes, methods, etc.?

  • Comments: Are the comments clear and useful?

  • Style: Does the code follow the style guides?

  • Documentation: Did the developer also update relevant

代码审查的一些原则

  • The purpose is not to reject the code (the goal is to accept and ship the code).

  • Technical facts and data overrule opinions and personal preferences.

  • Follow specific guidelines.

  • Be constructive and specific.

  • Review and respond in a timely fashion.

Code Review Developer Guide @ Google
Code Review Guidelines @ GitLab