单元测试、黑盒测试和白盒测试 [英] Unit testing, Black-box testing and white box testing

查看:41
本文介绍了单元测试、黑盒测试和白盒测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是单元测试、黑盒测试和白盒测试?我用谷歌搜索,但我发现的所有解释都非常技术性.谁能用一个适当的例子以简单的方式回答这个问题?

What is Unit testing, Black-box testing and White-Box testing? I googled but all the explanation I found was very technical. Can anyone answer this question in a simple way with an appropriate example?

推荐答案

黑盒测试中,您并不关心被测试事物的内部结构如何工作.您调用公开的 API 并检查结果;你不在乎被测试的东西做了什么给你结果.

In black box testing, you don't care how the internals of the thing being tested work. You invoke the exposed API and check the result; you don't care what the thing being tested did to give you the result.

白盒测试中,您确实关心被测试事物的内部结构如何工作.因此,您不仅可以检查事物的输出,还可以检查被测试事物的内部变量是否正确.

In white box testing, you do care how the internals of the thing being tested work. So instead of just checking the output of your thing, you might check that internal variables to the thing being tested are correct.

单元测试是一种测试软件组件的方式.单元"是被测试的东西.您可以使用单元测试进行黑白盒测试;这个概念与白盒/黑盒测试是正交的.

Unit testing is a way of testing software components. The "Unit" is the thing being tested. You can do both black and white box testing with unit tests; the concept is orthogonal to white/black-box testing.

这篇关于单元测试、黑盒测试和白盒测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆