当前位置:网站首页>Test how students participate in codereview
Test how students participate in codereview
2022-06-27 10:00:00 【That year - it was snowy】
Preface
Code Review, abbreviation CR, That is what we often call code review .Code Review Mainly in the development process , Review the code . The goal is to improve code quality and standardization , Identify potential defects and BUG, Reduce repair costs . At the same time, it can also improve the level of developers . Now more and more companies have put Code Review As a necessary part of the R & D process .
In everyone's subconscious ,Code Review It's development work , As long as the development is involved . It has nothing to do with the test students . But with the popularity of testing the left shift concept in recent years ,Code Review It can be used as one of the links to test the left shift . During the test process, combine Code Review It can greatly improve the test quality and efficiency .
Why participate in Code Review?
1、 Find problems at a lower cost
Some simple mistakes are often made through Code Review You can find , Such as calculation error 、 Wrong value type ( The variables that store time use string Is the type appropriate )、 No exception capture 、 Boundary values are not processed, etc .
Deming Mr. Zhang once proposed that “ The earlier the problem is discovered , The lower the cost of repair ”. Indicated by data ,85% All the defects are introduced in the code coding stage , However, most defects are not found during coding , It was discovered during the later test , And the more defects are found later .

according to STICKYMINDS An article on the website is called The Shift-Left Approach to Software Testing In the article of ( Pictured above ), If the defects found in the coding phase only need 1 It'll take minutes , Then the unit test phase needs 4 minute , Required in functional test stage 10 minute , Required in system test phase 40 minute , However, it may be necessary to 640 Minutes to repair , The cost is very high .
So if the students have the ability to pass the test Code Review I found the problem , It can not only reduce the cost of fixing problems , It also improves the overall efficiency .
2、 Define the scope of the test , Conduct accurate testing
adopt Review Code , Understand code change points , Be able to test the change point and change Association point of the development code , And accurately determine the scope of regression test , It avoids the waste of testing resources caused by full regression , It also reduces the risk of missing measurements .
3、 Control the code range of online requirements
Once before Code Review when , It is found that a developer has merged the requirement codes that are not part of the launch of this version , Later, it was proved that it was misoperation , And eliminate the corresponding code .
If this part of the code goes online without testing , It may greatly affect the normal online functions . This is a situation that no one wants to see .
Some students will say , Before the release, the developer will check the corresponding code , It is OK to eliminate it before going online . If that's the case , After code culling , Some resolved conflicts will be restored , The test students have to make another comprehensive regression , Very time-consuming and risky .
4、 Smaller requirements can be found in Code Review Then go online directly
Often, some requirements only involve the change of relevant configuration files , such as , Somewhat logo Pictures are uploaded to the storage platform , hold url Put it in the configuration platform , If you design / The product needs to be replaced logo, Directly modify the relevant configuration , product / The design can be directly accepted , No more corresponding tests , It also greatly saves testing time .
5、 Faster positioning problems
Skilled students can combine logs and code , Quickly locate to appear bug The code line of , Submitting bug Submit the relevant code information when , Development can be modified directly , While improving efficiency , It will also make developers more convinced of us !
When to do Code Review Well ?
Before the test , At the end of the development coding after , Put the development branch before the test branch code review, You can read the code by yourself , You can also participate in the development code review meeting , Participation at this time , You can compare your understanding of requirements with your development and implementation , Align relevant information in a timely manner .
Functional test found bug when , At this time, you can go through the code , The reason for the failure , Point out the detailed error code line and inform the developer , It can improve the development and repair bug The efficiency of , It also reduces the recurrence of development bug Time for .
Repair bug after , Walk through the code records submitted by development , See if new bug.
Before going online , View development merge Code range , Check if only merge The code for the current requirement to go online , Whether it contains other code that does not need to go online , etc. .
Test students in Code Review What should be paid attention to in ?
Develop students in review Code time , Will check the readability and maintainability of the code , Will focus on the design of the code , Whether the logic and business are correct , Relevant design patterns used, etc , But for testing , We should focus on code logic , And common defects .
CR front :
stay CR We need to have a comprehensive understanding of the requirements before , Have their own ideas on how to realize the requirements . Compare the difference between your own ideas and the developed implementation logic , What are the advantages of development implementation ? What are the shortcomings of your thinking ? There are no loopholes in the implementation ? Doing so can not only deepen your understanding of the business , Can also greatly improve their code ability and design ability !
CR when :
stay CR Pay attention to the implementation details of the developed code , And check and make up for their own test cases , To perfect the test scenario , It can also be used to test the redundancy in the design case Into the ⾏ clear , Avoid repetition ⽆⽤ Test of .
in addition , In addition to paying attention to the changes this time , Also note if you accidentally change the code elsewhere , Affect existing functions .
secondly , stay review Code time , We can also focus on common defects , Here are a few :
- The parameters of the function , Whether the parameter is used by the function or normally
- data type Use... For a value int still double;
- Divisor is 0、 Integer overflow 、 Loss of accuracy ;
- Possible dead cycle ;
stay finally Closing or freeing resources in a block ;
exception handling , Whether the exception is handled correctly , The most common null pointer exceptions should be concerned with ;
Formula calculation error ;
String comparison cannot be used ==, Use equals;
Array may be out of bounds ;
Pass reference error ; Type conversion error ;
Wrong selection of condition range ;
Boundary value treatment ;
wait ...
How to participate in Code Review, Record common defects , summary 、 Sort out your own experience , It will be more and more convenient .
Make full and reasonable use of code review, It can not only reduce the cost of finding and modifying problems , It can also improve test quality and efficiency . You can also learn about the subtleties of the code , Quickly improve your programming level .
边栏推荐
- 三层架构中,数据库的设计在哪一层实现,不是在数据存储层吗?
- Location and solution of network connection failure of primary online mobile terminal Report
- R語言plotly可視化:可視化多個數據集歸一化直方圖(historgram)並在直方圖中添加密度曲線kde、設置不同的直方圖使用不同的分箱大小(bin size)、在直方圖的底部邊緣添加邊緣軸須圖
- 分布式文件存储系统的优点和缺点
- 技术与业务同等重要,偏向任何一方都是错误
- Only one confirmcallback is supported by each rabbittemplate
- R语言plotly可视化:可视化多个数据集归一化直方图(historgram)并在直方图中添加密度曲线kde、设置不同的直方图使用不同的分箱大小(bin size)、在直方图的底部边缘添加边缘轴须图
- Win10快捷键整理
- 通俗易懂理解朴素贝叶斯分类的拉普拉斯平滑
- 基于STM32设计的蓝牙健康管理设备
猜你喜欢

Product strength benchmarking seal /model 3, with 179800 pre-sales of Chang'an dark blue sl03

【HCIE-RS复习思维导图】- STP

. Net

通俗易懂理解朴素贝叶斯分类的拉普拉斯平滑

There is no doubt that this is an absolutely elaborate project

Tdengine invitation: be a superhero who uses technology to change the world and become TD hero

前馈-反馈控制系统设计(过程控制课程设计matlab/simulink)

Take you to play with the camera module

SVN版本控制器的安装及使用方法

On anchors in object detection
随机推荐
Comparison between new and old interfaces
2-4Kali下安装nessus
Video file too large? Use ffmpeg to compress it losslessly
Advantages and disadvantages of distributed file storage system
This application failed to start because it could not find or load the QT platform plugin
[so official interview] Why do developers using rust love it so much
prometheus告警流程及相关时间参数说明
Location and solution of network connection failure of primary online mobile terminal Report
CPU设计(单周期和流水线)
Principle and application of the most complete H-bridge motor drive module L298N
Quartz(定时器)
Pakistani security forces killed 7 terrorists in anti-terrorism operation
【SO官方采访】为何使用Rust的开发者如此深爱它
细说物体检测中的Anchors
Source insight 工具安装及使用方法
如何获取GC(垃圾回收器)的STW(暂停)时间?
Google browser chropath plug-in
Technology is as important as business. It is wrong to favor either side
Win10快捷键整理
C語言學習-Day_04