当前位置:网站首页>程序员成长第八篇:做好测试工作
程序员成长第八篇:做好测试工作
2022-07-05 12:51:00 【51CTO】
在大部分公司,程序员做完功能后,会有专门的测试部门同学来进行专业的测试。其实早期很多大公司都没有测试岗,是随着测试的技能越来越多,对能力要求越来越高,才专门有了测试的岗位。
但我觉得哪怕公司有测试工程师,作为研发人员,自己也要会测试。懂一些测试思维。想一想,如果在团队里,你每次提交的代码,反馈的bug最多。是不是也脸上无光?
我觉得以下几点,是每个研发人员都应该思考和锻炼的。
一、非正常情况思考。在惯性思维下,我们会在测试某个功能的时候都是按照正常值输入。比如提现功能。我们会测试一个正数。非正常情况是,我们输入一个0或者一个负数或者非数字,软件会如何反馈?前端是否有做控制?后端是否有做控制。只有两者都做控制才是正确的。
二、极端异常情况思考,比如弱网环境,会造成请求失败,是否需要重连?重连的机制是怎样?又比如输入项是个数组,正常情况我们会传入一个数组,非数组情况,我们做好处理外,还要考虑极端情况,比如传入一个非常大的数组,程序是会卡死崩掉,还是如何?这需要在写代码的时候就考虑好。
三、做好单元测试。单元测试是用来对一个模块、一个函数或者一个类来进行正确性检验的测试工作。一般我们会通过程序自动化来跑单元测试。如果出问题,我们一般会先跑一下单元测试,这个通过后,才去找问题原因。
四、做好功能测试。跑完单元测试后,再做功能测试。因为就算每个独立模块都正常,但合起来还是有很多情况会出现问题。每次修改都需要自己跑一遍做过的功能。一般功能测试我们都是在真实/测试环境里进行,模拟数据测试的情况不算。
五、要有一个自己的问题库,把所有自己遇到过的bug以及解决方案都放到问题库里。如果公司有问题库就更好,如果没有,你也可以跟主管提建议组建。有了这个问题库,以后同类型的问题,都可以比较快速的找到解决方案,避免同样的问题,每次都需要从头解决一遍。
其实做测试有时候比写代码还难,因为写的时候你都是按照正常逻辑去思考和编码的,但测试后的时候需要你从各个不同场景去思考,这种批判性思考、逻辑思考、系统思考的能力,但很值得投入精力去锻炼。
边栏推荐
- Taobao short videos are automatically released in batches without manual RPA open source
- Solve Unicode decodeerror: 'GBK' codec can't decode byte 0xa2 in position 107
- CF:A. The Third Three Number Problem【关于我是位运算垃圾这个事情】
- HiEngine:可媲美本地的云原生内存数据库引擎
- DNS的原理介绍
- 由扫地增而引起的小叙
- Leetcode20. Valid parentheses
- A specific example of ABAP type and EDM type mapping in SAP segw transaction code
- Concurrent performance test of SAP Spartacus with JMeter
- SAP SEGW 事物码里的 ABAP 类型和 EDM 类型映射的一个具体例子
猜你喜欢
非技术部门,如何参与 DevOps?
石臻臻的2021总结和2022展望 | 文末彩蛋
I'm doing open source in Didi
Vonedao solves the problem of organizational development effectiveness
Pinduoduo flag insertion remarks API
我在滴滴做开源
Taobao order amount check error, avoid capital loss API
Small case of function transfer parameters
Get to know linkerd project for the first time
Solve Unicode decodeerror: 'GBK' codec can't decode byte 0xa2 in position 107
随机推荐
Super efficient! The secret of swagger Yapi
946. 验证栈序列
Setting up sqli lab environment
实现 1~number 之间,所有数字的加和
Default parameters of function & multiple methods of function parameters
Taobao product details API | get baby SKU, main map, evaluation and other API interfaces
Actual combat simulation │ JWT login authentication
Get to know linkerd project for the first time
Solve Unicode decodeerror: 'GBK' codec can't decode byte 0xa2 in position 107
Concurrent performance test of SAP Spartacus with JMeter
Cf:a. the third three number problem
Halcon template matching actual code (I)
Reshape the power of multi cloud products with VMware innovation
谈谈我写作生涯的画图技巧
From the perspective of technology and risk control, it is analyzed that wechat Alipay restricts the remote collection of personal collection code
自然语言处理系列(一)入门概述
Navigation property and entityset usage in SAP segw transaction code
How to connect the API interface of Taobao open platform (super detailed)
CVPR 2022 | single step 3D target recognizer based on sparse transformer
Rocky基础命令3