P4LQA HENF209736R0003 单元模块 通过两个耦合模块实现线路
一、什么是单元测试?
单元测试(unit testing),是指对软件中的zui小可测试单元进行检查和验证。至于“单元”的大小或范围,并没有一个明确的标准,“单元”可以是一个函数、方法、类、功能模块或者子系统。
单元测试通常和白盒测试联系到一起,如果单从概念上来讲两者是有区别的,不过我们通常所说的“单元测试”和“白盒测试”都认为是和代码有关系的,所以在某些语境下也通常认为这两者是同一个东西。还有一种理解方式,单元测试和白盒测试就是对开发人员所编写的代码进行测试。
提示:概念这个东西大概理解是什么意思即可~
二、单元测试谁来做?
想一想:前面我们介绍了,单元测试简单理解就是对开发人员所编写的代码进行测试,既然和代码相关我们第 一感觉那应该是“开发人员来做”;再一看单元测试包含“测试”两个字,那么“测试人员来做”也应该是合理的吧。
单元测试一般是有开发人员或测试人员来做。谁来做并没有一个绝 对的标准,要根据公司的实际情况来决定。接下来我们分析一下开发人员或测试人员做单元测试的优缺点:
开发人员做单元测试:
优点:开发人员对代码zui熟悉,而且开发人员编程技能相对比较强,所以开发人员自己写单元测试效率上和覆盖率上都比较高
缺点:开发人员平时写业务代码就要花费很多时间,有时候确实没有时间写单元测试;而且大部分开发人员没有太好的测试思想,单元测试可能只是写个zui简单的用例就完了;自己写的代码自己测,往往都是不靠谱!
测试人员做单元测试:
优点:测试人员有比较系统的测试思想,可以更好地保证用例的覆盖。而且通过写单测测试能更好地了解具体代码结构、流程,对于后续的业务测试也非常有利。


P4LQA HENF209736R0003 单元模块 通过两个耦合模块实现线路
What is unit testing?
unit testing refers to the inspection and verification of the smallest testable unit in software. There is no clear standard for the size or scope of a "unit", which can be a function, method, class, functional module, or subsystem.
Unit testing is often associated with white box testing, and the two are conceptually different, but what we commonly call "unit testing" and "white box testing" are both considered to be related to code, so in some contexts they are often considered to be the same thing. Another way to think about it is that unit testing and white box testing are tests of the code that developers write.
Hint: The concept of this thing roughly understand what it means to ~
Who will do the unit testing?
Think about it: before we introduced, the simple understanding of unit testing is to test the code written by developers, since the code is related to our first feeling that it should be "developers to do"; If unit tests contain the word "test," then "testers do it" is reasonable.
Unit testing is usually done by developers or testers. There is no absolute standard for who will do it, and it should be decided according to the actual situation of the company. Let's look at the advantages and disadvantages of unit testing as a developer or tester:
Developers do unit testing:
Advantages: Developers are most familiar with the code, and developers programming skills are relatively strong, so developers write their own unit tests on efficiency and coverage are relatively high
Disadvantages: Developers usually spend a lot of time writing business code, and sometimes do not have time to write unit tests; And most developers don't have a good idea of testing, so unit testing may just be about writing the simplest use case; The code written by oneself is often unreliable!
Testers do unit tests:
Advantages: Testers have more systematic testing ideas, which can better ensure the coverage of use cases. And by writing a single test can better understand the specific code structure, process, for the subsequent business testing is also very beneficial.
P4LQA HENF209736R0003 单元模块 通过两个耦合模块实现线路
| ABB CVC750AE101 3BHB005171R0101 IGCT Int |
| ABB PFSK152-B | 3BSE018877R2 | PFSK 152- |
| ABB 5SHY3545L0028 Asymmetric Integrated |
| ABB ACU-01 | 3HNA013719-001 | robot spra |
| ABB DCF503B0050-000000X | 3ADT209019R020 |
| ABB REF542PLUS | REF542 Plus | HMI Unit |
| ABB XUD194 | 3BHC018137R0001 | AC 800PEC |
| ABB 5SHX0845F0001 | 3BHL000385P0101 | 5S |
| ABB PFRL101C-2.0kN | Pressductor Radial |








QQ在线客服