当前位置:网站首页>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 .
边栏推荐
- 强化学习中好奇心机制
- flutter 微信分享
- Scientists develop two new methods to provide stronger security protection for intelligent devices
- js 所有的网络请求方式
- Tdengine invitation: be a superhero who uses technology to change the world and become TD hero
- js中的数组对象
- C language learning day_ 06
- 队列,双向队列,及其运用
- LVI Sam summary
- Your brain is learning automatically when you sleep! Here comes the first human experimental evidence: accelerate playback 1-4 times, and the effect of deep sleep stage is the best
猜你喜欢

oracle触发器 存储过程同时写入

prometheus告警流程及相关时间参数说明

This application failed to start because it could not find or load the QT platform plugin

mysql数据库汉字模糊查询出现异常

Prometheus alarm process and related time parameter description

Principle and application of the most complete H-bridge motor drive module L298N

Your brain is learning automatically when you sleep! Here comes the first human experimental evidence: accelerate playback 1-4 times, and the effect of deep sleep stage is the best

Stop using system Currenttimemillis() takes too long to count. It's too low. Stopwatch is easy to use!

【系统设计】邻近服务

TDengine 邀请函:做用技术改变世界的超级英雄,成为 TD Hero
随机推荐
Reading and writing Apache poi
Record in detail the implementation of yolact instance segmentation ncnn
[200 opencv routines] 212 Draw a slanted rectangle
Stop using system Currenttimemillis() takes too long to count. It's too low. Stopwatch is easy to use!
强化学习中好奇心机制
Use aspese Cells convert Excel to PDF
【SO官方采访】为何使用Rust的开发者如此深爱它
Vector:: data() pointer usage details
片刻喘息,美国电子烟巨头禁令推迟,可暂时继续在美销售产品
R語言plotly可視化:可視化多個數據集歸一化直方圖(historgram)並在直方圖中添加密度曲線kde、設置不同的直方圖使用不同的分箱大小(bin size)、在直方圖的底部邊緣添加邊緣軸須圖
When does the mobile phone video roll off?
12个网络工程师必备工具
torchvision. models._ utils. Intermediatelayergetter tutorial
DNS standby server information, DNS server address (how many DNS preferred and standby are filled in)
C language learning day_ 04
Location and solution of network connection failure of primary online mobile terminal Report
CPU design (single cycle and pipeline)
.NET 中的引用程序集
多线程实现 重写run(),怎么注入使用mapper文件操作数据库
感应电机直接转矩控制系统的设计与仿真(运动控制matlab/simulink)