当前位置:网站首页>Code Inspection for DevOps
Code Inspection for DevOps
2022-08-02 20:33:00 【InfoQ】
什么是代码检查

Why want to do code review
- 可读性:The code is not just to the machine understanding,也是给人看的.To be able to make the team everyone can easily read and understand the code.
- 可维护性:When maintenance and test the quality of the code easier to、Safety and save time,And not easy to out of the question.
- Reduce the technical debt:High quality code design good,Technical debt less,Developers do not need to spend a lot of time to repair problems and refactoring the code,因此,Can quicken the pace of the software development.The new team members are easy to understand code,It is easier to join the project.
Code review practice
本地检查
- According to the principle of check the pre,The timing of the local inspection is the most appropriate,Find and fix problems cost is the lowest;
- 因为是在本地执行,Perform check the efficiency of the fastest.
- Developers need to have high consciousness.
- IDE 插件:SonarLint、FindBugs、CheckStyle、PMD、Ali specification etc,You can check code coding style,坏味道,漏洞等.
- 本地构建:maven 编译、gradle 编译,You can check code grammar problem,Whether can be compiled.
- 本地测试:单元测试,Can check code logic problems.

本地提交检查
- Check the timing of the moderate;
- Check the high efficiency;
- 基于 Git 的 Hook 机制,在每次提交时运行 Hook,Automatic identification code of the simple question,Code reviewers focus on logic and system structure,Avoid because of trivial problem style and a waste of time.
- Local commits to the required high speed,Only static checking to save time,Such as code style;
- 客户端的 Hook,Because it is in local developers,Did not achieve full“强制”检查;
- Also relies on the developer's consciousness.
远程提交检查
- Can be relatively deep dynamic check,比如漏洞、Bug,It is better to check the;
- Can do the compulsory inspection,Ensure that anyone to submit code are of high quality;
- Code submitted did not directly submitted to the code base,Add artificial review link,Check code for business logic and architecture design more complex problems, such as;
- 可以控制每次提交的代码质量.
- The timing of the check on the,反馈周期较长;
- Need to set up the code check the server;
- 维护成本较高;
- 每次提交都检查,Will slow down the team's development pace.
Branch merge check
- Each time the inspection branch and fashionable,Can control and in other branches of code quality,Does not affect the development rhythm;
- Branches usually indicates a function at the time of merger and problems developed,There can be a relatively ample time to perform more deep dynamic check,比如漏洞,Bug 等;
- You can set the mandatory inspection,Ensure us into branch code is of high quality;
- 可以做 Code Review,Who review one-time review the function of the complete code(Don't recommend branch for a long time,大功能开发);
- 代码托管平台支持,如 GitHub、GitLab.
- The timing of the check on the,反馈周期较长.
Common inspection tools and practice
代码检查
人工评审
自动化测试
总结
边栏推荐
- 百问百答第49期:极客有约——国内可观测领域SaaS产品的发展前景
- MySQL索引
- 有关代购系统搭建的那点事
- POE交换机全方位解读(中)
- 2022安全员-C证考试题库模拟考试平台操作
- 本地MSE播放fragment mp4服务
- 天翼云4.0分布式云赋能千行百业数字化转型
- Wechat Gymnasium Appointment Mini Program Graduation Design Finished Works Mini Program Graduation Design Finished Work (6) Question Opening Reply PPT
- 54.【system系统互动函数大总结】
- Wechat Gymnasium Appointment Mini Program Graduation Design Finished Work (5) Task Book
猜你喜欢

红队实战靶场ATT&CK(一)

mysql四种隔离级别

vulnhub W34kn3ss: 1

潮玩的“第二春”,在哪?

织梦自定义表单添加全选和全不选功能按钮

MySQL命令(命令行方式,而非图形界面方式)

Playing in the cloud | The key technology of Tianyi cloud object storage ZOS high availability is revealed

Flink Learning 9: Configure the idea to develop the flink-Scala program environment

Mini Program Graduation Works WeChat Gymnasium Reservation Mini Program Graduation Design Finished Product (8) Graduation Design Thesis Template

小程序毕设作品之微信体育馆预约小程序毕业设计成品(5)任务书
随机推荐
LiveGBS国标GB/T28181流媒体平台支持主子码流切换主码流stream/streamprofile
基于HDF的LED驱动程序开发(1)
mysql四种隔离级别
一文看懂推荐系统:概要01:推荐系统的基本概念
搭建属于自己的知识库(Wikijs)
面试官:可以谈谈乐观锁和悲观锁吗
每日优鲜倒了,叮咚买菜的春天在哪?
玩转云端 | 天翼云对象存储ZOS高可用的关键技术揭秘
mui中使用多级选择器实现省市区联动
golang刷leetcode 经典(5)设计哈希集合
How a "cloud" can bring about new changes in the industry
ES: export 的用法
Dream weaving prompt information prompt box beautification
研发运营一体化(DevOps)能力成熟度模型
MySQL表的约束
Google Earth Engine APP—— 一个不用写代码可以直接下载相应区域的1984-2021年的GIF遥感影像动态图
无法超越的100米_百兆以太网传输距离_网线有哪几种?
Taking advantage of cloud-network integration, e-Surfing Cloud has paved the way for digital transformation for government and enterprises
解决多版本jar包冲突问题
HDF驱动框架的API(1)