代码走查和代码审查

什么是代码审查? (What are Code Reviews?)

A Code Review is essentially what it sounds like: a review of code before it is approved/accepted into the codebase. The general flow goes like this; an engineer writes some code in order to fix a bug/address some item of work. The engineer sends out a Code Review/Pull Request, basically asking for their changes to be accepted into the main body of project. One or more other engineers review the code changes, leaving comments/feedback, and either approves or rejects the changes. Rejection is often a temporary state asking for the comments/feedback to be addressed and the updated changes submitted again for approval.

本质上,代码审查听起来像是:在批准/接受代码库之前对代码进行审查。 总体流程如下: 工程师编写一些代码来修复错误/解决某些工作。 工程师发出一个“代码审查/拉取请求”,基本上是要求他们的更改被接受到项目主体中。 一个或多个其他工程师检查代码更改,留下评论/反馈,然后批准或拒绝更改。 拒绝通常是一种临时状态,要求处理评论/反馈,并再次提交更新的更改以供批准。

The idea of this flow is to ensure that code entering the project meets a variety of expectations and standards, enforced by everyone on the team. The requirements being enforced often include coding style standards, unit/other testing, and general code quality. This process also provides an opportunity to spot check the code for any potential bugs, logic issues or other problems. It is common for this approval gate to require at least two other engineer’s approval before the code changes are allowed to move forward. But all parts of this process vary significantly team by team.

该流程的目的是确保进入项目的代码满足团队中每个人都执行的各种期望和标准。 强制执行的要求通常包括编码样式标准,单元/其他测试以及常规代码质量。 此过程还提供了机会来检查代码是否存在任何潜在的错误,逻辑问题或其他问题。 通常,在允许更改代码进行之前,此批准门通常需要至少两个其他工程师的批准。 但是此过程的各个部分在团队之间差异很大。

Code Reviews should not be the place where feature/implementation design feedback is discussed. This should happen long before code starts to be written.

代码评审不应成为讨论功能/实现设计反馈的地方。 这应该早在开始编写代码之前发生。

他们还提供什么其他好处? (What Other Benefits Do They Offer?)

As outlined above, Code Reviews provide a number of quality gate, process, and standardization benefits. But there are many more, often less appreciated, potential benefits to the team, the resulting code, and the project as a whole. These are just my top three.

如上所述,代码审查提供了许多质量控制,过程和标准化方面的好处。 但是,对于团队,所产生的代码以及整个项目而言,还有很多(通常是很少被人们所理解的)潜在利益。 这些只是我的前三名。

分享项目知识 (Sharing project knowledge)

Code Reviews are a great way to broadcast detailed knowledge about what changes are happening on a project. Having knowledge shared through the team versus locked up in silos (worst case in silos of one), has a very tangible impact on a project’s momentum and future. For those on the team actively participating in the Code Reviews, it acts as a ‘news beat’ or a pulse of the changes flowing into the codebase. This enables engineers to both stay up to date on how things work, but also allows them to plan their current and future work by taking these changes into account. For example, seeing an area of code is changing can help avoid conflicts if another engineer is about to make changes in the same area. Additionally, it may influence the implementation details of their next task if there is overlap.

代码审查是一种传播有关项目中正在发生的更改的详细知识的好方法。 通过团队共享知识,而不是陷入孤岛( 最坏的情况是一个孤岛 ),对项目的发展势头和未来产生了非常明显的影响。 对于那些积极参与代码审查的团队而言,它就像是“新闻快讯”或流向代码库的变更脉动。 这使工程师不仅可以随时了解工作原理,还可以通过考虑这些变化来计划当前和将来的工作。 例如,如果另一个工程师要在同一区域进行更改,那么查看代码区域是否正在更改可以帮助避免冲突。 此外,如果有重叠,可能会影响其下一个任务的实现细节。

On top of all of this, if your project involves an element of on-call rotation for handling live site issues/incidents, then Code Reviews provide a heads up for changes about to be deployed to Production. The on-call engineer can use the feed of incoming code changes to raise their awareness of what is changing. This helps speed up the identification of the source of issues if things start to fail in Production. When incidents occur, it is often due to changes somewhere in the pipeline.

最重要的是,如果您的项目涉及用于处理现场现场问题/突发事件的呼叫轮换元素,则代码审查会提供有关即将部署到生产中的更改的提示。 待命工程师可以使用传入代码更改的提要来提高他们对更改内容的意识。 如果生产中开始出现故障,这有助于加快问题来源的识别。 发生事件时,通常是由于管道中某处的更改。

教书的机会 (Opportunities to teach)

Having a gate blocking unreviewed code changes going in helps ensure the health and quality of the codebase. But keeping the quality of code high requires continuous learning and education across the whole team. Code Reviews provide a direct and explicit way for the senior members of the team to teach those that are more junior. The very intent of a Code Review is to seek feedback and make the necessary changes before the code is considered ready. This explicitness removes some of the awkward barriers around providing feedback. In the context of a Code Review, the feedback is not unwarranted or unprovoked criticism. It is sought after and discussed in a public venue. This transparency helps ensure that the feedback provided is constructive and allows the feedback itself to be reviewed and critiqued.

有一个门来阻止未审查的代码更改,有助于确保代码库的健康和质量。 但是要保持较高的代码质量,需要整个团队不断学习和教育。 代码审查为团队的高级成员提供了直接和明确的方式来教那些初级的成员。 代码审查的目的是在代码准备就绪之前寻求反馈并进行必要的更改。 这种明确性消除了提供反馈方面的一些尴尬障碍。 在《规范审查》的背景下,反馈并非无端或无端的批评。 在公共场所受到追捧和讨论。 这种透明性有助于确保所提供的反馈具有建设性,并允许对反馈本身进行审查和评论。

Encouraging this culture of asking for, providing, and accepting feedback as part of the standard process helps the team move forward in a unified way. Many senior engineers will eagerly take the opportunity to help drive the team’s standards, mentor those more junior to the codebase, and lead by example. And this is a great growth opportunity for them.

鼓励在标准流程中寻求,提供和接受反馈的这种文化有助于团队以统一的方式前进。 许多高级工程师将热切地抓住机会,帮助推动团队的标准,指导那些对代码库更初级的人,并以身作则。 对于他们来说,这是一个巨大的增长机会。

学习机会 (Opportunities to learn)

Receiving constructive feedback directly on the code you are developing is a great way to keep you focused on code quality. But Code Reviews offer other, more fruitful, ways to learn too.

直接接收有关正在开发的代码的建设性反馈是使您专注于代码质量的好方法。 但是Code Review还提供了其他更有效的学习方法。

Code Reviews are a great opportunity for those new to a codebase to see how the more seasoned on the team work. By taking the time to peruse current and existing Code Reviews, an engineer can get insight into how the team operates and how specific engineers approach problems. It is a good way to get exposure to different coding styles, problem solving and design patterns, and the inner workings of a system. As well as to observe the etiquette of the team, both in how they give and receive feedback, as well as adherence to coding standards and other expectations. Ideally, the Code Reviews should also provide specific context on the code being observed and discussion/feedback around the choices made, versus trying to wade through an enormous codebase without a guide.

对于那些刚接触代码库的人来说,代码审查是一个很好的机会,以了解团队中经验更丰富的人员如何工作。 通过花时间仔细阅读当前和现有的代码审查,工程师可以洞悉团队的运作方式以及特定工程师如何解决问题。 这是接触不同编码风格,问题解决和设计模式以及系统内部工作的好方法。 除了观察团队的礼节外,他们如何提供和接收反馈,以及遵守编码标准和其他期望。 理想情况下,代码审查还应该提供有关正在观察的代码的特定上下文以及围绕所做选择的讨论/反馈,而不是尝试在没有指南的情况下浏览庞大的代码库。

Given all these reasons I strongly encourage every engineer on my team to carve out time to participate in Code Reviews. Whether they are seniors helping raise the standards and educate others, juniors looking to expand their experience and exposure to other’s code, or anyone wanting to keep relevant on the changes flowing into a project. There is a lot of information to be gained by being a part of those discussions.

出于所有这些原因,我强烈鼓励团队中的每位工程师花时间参加代码审查。 无论他们是帮助提高标准和教育他人的高年级学生,还是希望扩大他们的经验并接触他人法规的大三学生,还是任何想与项目变更保持联系的人。 作为这些讨论的一部分,可以获得很多信息。

翻译自: https://towardsdatascience.com/the-other-reasons-code-reviews-are-a-good-idea-e57399499558

代码走查和代码审查


http://www.taodudu.cc/news/show-2025889.html

相关文章:

  • 【敏捷开发每日一贴】代码走查
  • Mybatis-代码走查问题整理
  • 制度罚则-- 代码走查规范
  • 测试人员代码走查基础要点
  • java 代码走查_Java代码走查具体考察点
  • 代码走查(Code Review)25条疑问
  • 代码走查1
  • 案例:如何评价代码走查的效果?
  • JAVA代码走查审查规范
  • java代码走查_java代码开发完成后,代码走查规范
  • java 代码走查_代码走查如何保证软件质量
  • 代码检查、走查与评审
  • 代码的检查走查与评审
  • 内网穿透工具,微信支付支付宝支付的沙箱接口回调地址
  • php支付接口要改动的参数,京东支付接口2.0PHP集成遇到的一些问题:所有参数必须是string!...
  • ECSHOP 大商创 对接易支付接口
  • php支付接口要改动的参数,php支付接口_php支付宝支付接口程序及参数详解
  • RN对接京东支付sdk(IOS)
  • RN对接京东支付sdk(Android)
  • 【专项测试】京东“安全测试”
  • php京东接口开发,技术文档
  • 防京东接口
  • 支付宝、财付通、网银、百度钱包、京东钱包接口费率
  • uniapp 让支付触手可及,封装了微信支付、QQ支付、支付宝支付、京东支付、银联支付常用的支付方式以及各种常用的接口
  • android 支付接口
  • 支付宝、京东支付场景之策略模式实战
  • 京东下单接口sdk java,Flutter 插件开发-接入京东SDK唤醒(ios篇)
  • 京东快捷支付的安全隐患
  • 支付安全不能说的那些事
  • 京东 php,[分享] 京东接口2.0 PHP版SDK

代码走查和代码审查_代码审查是个好主意的其他原因相关推荐

  1. 代码走查和代码审查_代码审查随时间而变化

    代码走查和代码审查 我们已经进行了大约4年的代码审查 . 代码审查入门 从一开始,开发人员就会互相帮助,在有人询问时查看代码,或者有时主管或高级开发人员会介入并检查代码,如果我们发现测试存在问题,或者 ...

  2. java 代码审查_代码审查(Code Review)清单

    代码审查可以帮助提高代码质量,避免由于代码习惯而造成的 bug.下面列出的这些要点因该可以作为大部分代码审查的指导,如果是 Java 应用的话,这些建议应该被视作最佳实践. 文档 1. Javadoc ...

  3. 代码走查和代码审查_如何避免代码审查陷阱降低生产率

    代码走查和代码审查 Code reviewing is an engineering practice used by many high performing teams. And even tho ...

  4. 代码走查和代码审查_不要在代码审查上浪费时间

    代码走查和代码审查 不到一半的开发团队进行代码审查 ,而另一半可能未充分利用代码审查. 这是不浪费时间在代码审查上的方法. 把事情简单化 许多人仍然认为代码审查是昂贵的正式代码检查会议 ,需要大量准备 ...

  5. 审查指南 最新版本_代码审查-最终指南

    审查指南 最新版本 by Assaf Elovic 通过阿萨夫·埃洛维奇 代码审查-最终指南 (Code Review - The Ultimate Guide) 构建团队代码审查流程的终极指南 (T ...

  6. 如何有效地执行代码审查_使用这些有效的代码审查指南创建合理的办公环境

    如何有效地执行代码审查 by Sandor Dargo 由Sandor Dargo 使用这些有效的代码审查指南创建合理的办公环境 (Create a sane office environment w ...

  7. 审查元素为什么看不见代码_代码审查:我们为什么这样做?

    审查元素为什么看不见代码 许多组织的开发人员都将代码审查作为他们的核心实践之一. 尽管这听起来很合理,但是随着时间的流逝,导致采用该实践的目标被遗忘了,唯一剩下的就是实践本身的盲目应用. 为什么我们需 ...

  8. 代码审查清单 Code Review

    代码审查清单 常规项 代码能够工作么?它有没有实现预期的功能,逻辑是否正确等. 所有的代码是否简单易懂? 代码符合你所遵循的编程规范么?这通常包括大括号的位置,变量名和函数名,行的长度,缩进,格式和注 ...

  9. 转:高效代码审查的八条准则和十个经验

    代码审查(Code Review)是软件开发中常用的手段,和QA测试相比,它更容易发现和架构以及时序相关等较难发现的问题,还可以帮助团队成员提高编程技能,统一编程风格等. 1. 代码审查要求团队有良好 ...

  10. 超 6 万的微软工程师是如何进行代码审查的?| CSDN 博文精选

    微软共有 14 万员工,其中大约 44%(超过6万)是工程师,你是否想知道大厂是如何通过代码审查来保证代码质量的? 作者 | Michaela Greiler 译者 | Jackyzhe CSDN 博 ...

最新文章

  1. 边工作边刷题:70天一遍leetcode: day 27
  2. 用 Python 制作数据大屏,超简单
  3. 电脑键盘数字键失灵_C4D/3dmax/MaYa三维设计——高档机械键盘推荐·红轴(200元左右预算)...
  4. 【Linux】 Samba 服务器安装配置实现与Windows系统的文件共享服务
  5. idea main java.lang.ClassNotFoundException
  6. JVM(一) ---JVM的数据模型
  7. ORM的概念, ORM到底是什么
  8. ae导出json_关于AE转json动画开发避坑指南
  9. python --函数
  10. Wi-Fi 6连续两年出货量国内登顶,锐捷无线靠什么这么6?
  11. 详解DMZ的部署与配置:ISA2006系列之二十九
  12. Java并发编程-ConcurrentHashMap
  13. pytorch torch.empty
  14. 架构师Jack专访:全面认识软件测试架构师
  15. DirectSound学习笔记(2):创建设备对象
  16. php数组的概述及分类与声明
  17. Can I insert a countdown timer in a Powerpoint presentation?
  18. diskgeniuslinux版_DiskGenius 4.6.2 正式版发布,现已提供下载
  19. oracle plsql 命令,Oracle PlSQL常用命令
  20. 路由器、交换机、网关

热门文章

  1. 调色板 palette 详解
  2. 21天学通C语言-学习笔记(2)
  3. 计算机维护系统Win8PE,U盘启动计算机维护系统
  4. 算法精解----3、单链表
  5. Node.js中使用AWS SNS服务发送短信
  6. python3.7源码剖析——python对象
  7. LSTM神经网络介绍
  8. 文字转语音怎么在线生成MP3格式的音频?
  9. chrome浏览器关闭百度热搜——AdBlock插件
  10. fiddler 安装配置,连接手机,抓包QQ小程序