当前位置:网站首页>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。
边栏推荐
- Cglib dynamic agent -- example / principle
- Recoverable fuse characteristic test
- 测试/开发程序员的成长路线,全局思考问题的问题......
- Study diary: February 13, 2022
- 3D模型格式汇总
- 直播系统代码,自定义软键盘样式:字母、数字、标点三种切换
- The inconsistency between the versions of dynamic library and static library will lead to bugs
- Nmap: network detection tool and security / port scanner
- Distributed base theory
- BiShe - College Student Association Management System Based on SSM
猜你喜欢
![Cf:d. insert a progression [about the insert in the array + the nature of absolute value + greedy top-down]](/img/9e/c933f454a39d906a407e4d415f0b87.png)
Cf:d. insert a progression [about the insert in the array + the nature of absolute value + greedy top-down]

VMware Tools安装报错:无法自动安装VSock驱动程序

Mlsys 2020 | fedprox: Federation optimization of heterogeneous networks

Dedecms plug-in free SEO plug-in summary

2020.2.13

95后CV工程师晒出工资单,狠补了这个,真香...

View class diagram in idea

普通人下场全球贸易,新一轮结构性机会浮出水面

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

Exciting, 2022 open atom global open source summit registration is hot
随机推荐
FFT learning notes (I think it is detailed)
Opinions on softmax function
Mobilenet series (5): use pytorch to build mobilenetv3 and learn and train based on migration
关于softmax函数的见解
282. Stone consolidation (interval DP)
Hcip---ipv6 experiment
Nmap: network detection tool and security / port scanner
WordPress collection plug-in automatically collects fake original free plug-ins
File upload vulnerability test based on DVWA
vSphere实现虚拟机迁移
Recoverable fuse characteristic test
[pat (basic level) practice] - [simple mathematics] 1062 simplest fraction
Illustrated network: the principle behind TCP three-time handshake, why can't two-time handshake?
Promise
Construction plan of Zhuhai food physical and chemical testing laboratory
基于DVWA的文件上传漏洞测试
How to extract MP3 audio from MP4 video files?
037 PHP login, registration, message, personal Center Design
电气数据|IEEE118(含风能太阳能)
Kotlin core programming - algebraic data types and pattern matching (3)