问题标签 [white-box-testing]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
5369 浏览

testing - 多条件覆盖测试

当使用称为多条件覆盖的白盒测试方法时,我们是采用所有条件语句还是仅采用具有多个条件的语句?现在也许是名字中的线索,但我不确定。

所以如果我有以下方法

我是只为“条件 A”生成真值表,还是也为条件 B 生成真值表?

谢谢,

0 投票
6 回答
5208 浏览

testing - 白盒测试的缺点?

你能想到白盒测试的任何缺点吗——除了测试人员需要了解和理解代码(这可能会产生成本)吗?

谢谢,

0 投票
1 回答
542 浏览

white-box-testing - WBT 捕获的错误,但 BBT 捕获的错误,反之亦然

你能想到一种使用白盒测试可能发现的错误,以及一种使用黑盒测试的类型吗?即一个错误会被一个而不是另一个找到。

对于 WBT 会有 null else 语句,但是你会用 BBT 而不是 WBT 捕捉到什么?

顺便说一句,这个问题只是基于我自己的个人研究 - 我没有从中获得免费分数!!!!

谢谢,

0 投票
1 回答
500 浏览

white-box - Questions on WhiteBox testing, ON-Units, Condition-Coverage

I am reading a book where I am getting stuck at few white box testing concepts. The article in the below link is taken exactly from the book. http://testdesigners.com/testingstyles/ControlFlowTesting.html

1. 'ON-Units' terminology is introduced first in the 'Decision Coverage' article without describing what it is. The article continues to use this term later which is hard without knowing what is the meaning of ON-Unit.

Questions - Is 'ON-Unit' a path that a decision takes or traverses ? How do one 'invoke' On units ?

2. In the example under 'Condition Coverage' DO K=0 TO 50 WHILE (J+K < QUEST)

The article goes to explain - "If one is using decision testing, the criterion can be satisfied by letting the loop run from K = 0 to 51, without ever exploring the circumstance where the WHILE clause becomes false"

Questions -

By the definition of decision coverage, the test cases should explore both the true and false branch of decisions at least once. In other words, K = 0 to 50 is not material because the While (J+K < Quest) is True branch and (J+K < QUEST) is false branch. Why does the article mention under decision coverage - Not exploring the While clause being false?

Also in the first part of the line in decision coverage, decision criterion is satisfied by letting the loop run from K = 0 to K = 51 that is just the true branch, decision criteria is not met alone by having a test case for True branch, why does the article say that this along is sufficient to meet the decision criteria?

0 投票
3 回答
3186 浏览

unit-testing - 单元测试应该是黑盒测试还是白盒测试?

假设我有三种方法,它们都非常相似,但输入类型不同:

这三个都使用相同的底层逻辑。例如:也许double版本是唯一比较数字的版本,而另外两个只是将它们的输入转换为double.

我们可以想象一些不同的单元测试:第一个输入更大,第二个更大,两个输入都是负数,等等。

我的问题

如果所有三种方法都有完整的测试集(黑盒,因为我们不假设核心实现是相同的)

或者

是否应该只对double版本进行大量测试而对其他两个版本进行轻微测试以验证参数转换(白盒测试,因为我们知道它们共享相同的实现并且已经在测试中进行了double测试)?

0 投票
2 回答
14691 浏览

testing - 单链表的测试用例

一般来说,链表问题有哪些好的测试用例?例如一个函数的测试用例,它发现并消除重复并返回指向第一个节点的指针。一些核心案例可能是:函数使用 c# 或 Java 而不是 c、c++。假设所有正整数作为列表的节点。

  • 无效的
  • 空列表
  • 带循环的链表
  • 列出所有重复项
  • 一个节点或 2 个节点的列表(2 个重复)
  • 没有重复
  • 该列表可能会遇到整数溢出,以防内存不足(取决于 32 位机器,64 位机器)
  • 安全测试、语言自动化、内存问题、性能和压力

还有什么?期待令人发指的测试用例..那里有专家吗?

0 投票
6 回答
17311 浏览

unit-testing - 白盒/黑盒测试:静态还是动态?

这是我的理解:

动态测试是在系统运行时执行的测试。静态测试在系统未运行时执行。

黑盒测试侧重于功能,并且在不了解程序内部运作的情况下执行。白盒测试在代码本身中寻找问题。

我想知道的是,可以说所有黑盒测试都是静态的吗?是否可以公平地说一些白盒测试是静态的(例如,检查源代码)而一些是动态的(分支/路径测试)?

0 投票
2 回答
403 浏览

design-patterns - Design patterns on programming to make white-box testing easier?

I am wondering whether there are some design patterns on programming to make programs easier for white-box testing. I am not talking about Unit Test, but higher level testing, such as white-box based functional testing, system testing or some boundary testing.

For example:

  1. For GUI based program, we can reserve a hidden switch to read inputs from a text file instead of GUI.

  2. For some HTTP based C/S application, providing a parameter to disable the gzip option during package transmit which make it easier to use Fiddler to change the HTTP package.

Any other patterns or principles?

0 投票
1 回答
872 浏览

unit-testing - 什么是 ON 单元?

软件测试的艺术包含对“ ON -units”的几个引用。这是测试用例设计部分的示例:

决策覆盖通常可以满足语句覆盖。由于每条语句都位于从分支语句或程序入口点发出的某个子路径上,因此如果执行每个分支方向,则必须执行每条语句。但是,至少有三个例外:

  • 没有决定的程序。
  • 具有多个入口点的程序或子例程/方法。仅当在特定入口点输入程序时,才可能执行给定的语句。
  • ON单位内的语句。遍历每个分支方向不一定会导致执行所有ON单元。

我以前没见过ON -unit 这个词,我在谷歌上找不到定义。什么是ON单元?

0 投票
1 回答
706 浏览

c++ - Visual Studio 2010 单元测试

我想用单元测试在我的源代码中测试几个函数。现在,如果我运行测试,我不会得到任何测试结果。

这是我尝试做的一个简单的代码片段:

有谁知道为什么这不起作用?