当前位置:网站首页>Code Review关注点
Code Review关注点
2022-07-06 01:16:00 【hursing】
Review可分为3个级别,高一级会包含低一级的内容。
一、初级,规范级
不熟悉相关代码,只能review是否遵守规范,以可读性为主。规范按照【语言>框架>系统平台>项目>公司>跟上下文相同】的优先级来遵守。关注点:
- 代码规范,命名:<变量|常量|函数|类|文件|目录>名的<大小写|缩写|减号或下划线>等
- 代码规范,格式:换行、空行、空格、tab或空格数、include/import排序等
- 代码规范,内容:注释、函数体行数限制、异常处理、不留僵尸代码、没有幻数、是否使用Lamda表达式等
- 代码规范,位置:目录、包或命名空间层次等
- 使用规范,内部约定:是否【统一用了或不能用】特定函数、接口、库。比如日志都通过封装类来打印
- 提交规范:commit log是否符合规范;是否不同任务(需求或bugfix)分开提交,是否同一个任务合并提交
- 分支规范:是否提交在正确的分支,例如版本。还有额外的要求,例如提测后不提交跟修复bug无关的代码,去下一个版本或临时分支提交。
- review流程规范:是否给正确的人review、抄送到位、按意见修改等
- 设计规范:遵守基本的设计原则,每个类职责简单清晰,解耦。
- 文档规范:复杂度高的话是否有必要写文档,实现和文档是否一致。
二、中级,性能架构级
熟悉相关代码但不熟悉需求,可更多关注技术设计,看重性能、可扩展性、可维护性、安全性、稳定性等。关注点:
- 跨模块/应用/端交互,设计是否合理,有没有引入耦合
- 设计原则和设计模式的应用
- 异步和原子性问题:Timer、跨线程、跨进程、锁
- 性能:IO时长,是否需要后台线程执行,是否有冗余操作,lazy load,SQL优化、算法复杂度等。
- 日志、埋点合理,异常情况的原因通过日志可查,也不滥用。
- 安全考虑:加密、检验等
- 重大异常有UI提示,便于用户帮忙定位问题。(这种场景不能靠产品来提出)
- 可扩展性:是否足够灵活地应对变化
- 是否会产生野指针或内存常驻对象
三、高级,需求级
又熟代码又熟需求,会关注更多细节,一般结对编程才会做到这个程度。关注点:
- UI:文案、大小、颜色、阴影、字体、对齐方式、前后层次、动画、图片、声音、视频等,不同状态下还可能不一样
- 功能与流程逻辑:出入口、状态与条件、规则(类型、精度、取值范围、默认值、显示格式、计算处理方式等)、异常情况(要知道概率和源头原因)。
- Bugfix,是否真的能解决bug。
边栏推荐
- 关于softmax函数的见解
- MCU realizes OTA online upgrade process through UART
- 黄金价格走势k线图如何看?
- Finding the nearest common ancestor of binary tree by recursion
- General operation method of spot Silver
- Promise
- Mobilenet series (5): use pytorch to build mobilenetv3 and learn and train based on migration
- 程序员成长第九篇:真实项目中的注意事项
- Cannot resolve symbol error
- Development trend of Ali Taobao fine sorting model
猜你喜欢

Illustrated network: the principle behind TCP three-time handshake, why can't two-time handshake?

Pbootcms plug-in automatically collects fake original free plug-ins

esxi的安装和使用

servlet(1)

电气数据|IEEE118(含风能太阳能)

MIT doctoral thesis | robust and reliable intelligent system using neural symbol learning

MobileNet系列(5):使用pytorch搭建MobileNetV3并基于迁移学习训练

Test de vulnérabilité de téléchargement de fichiers basé sur dvwa

Finding the nearest common ancestor of binary tree by recursion

Finding the nearest common ancestor of binary search tree by recursion
随机推荐
Convert binary search tree into cumulative tree (reverse middle order traversal)
cf:C. The Third Problem【关于排列这件事】
How to get the PHP version- How to get the PHP Version?
Unity | 实现面部驱动的两种方式
Getting started with devkit
BiShe - College Student Association Management System Based on SSM
网易智企逆势进场,游戏工业化有了新可能
Why can't mathematics give machine consciousness
Condition and AQS principle
Mysql--- query the top 5 students
Kotlin core programming - algebraic data types and pattern matching (3)
File upload vulnerability test based on DVWA
测试/开发程序员的成长路线,全局思考问题的问题......
The detailed page returns to the list and retains the original position of the scroll bar
面试必刷算法TOP101之回溯篇 TOP34
Gartner released the prediction of eight major network security trends from 2022 to 2023. Zero trust is the starting point and regulations cover a wider range
Five challenges of ads-npu chip architecture design
View class diagram in idea
Vulhub vulnerability recurrence 75_ XStream
Finding the nearest common ancestor of binary tree by recursion