|
我想单纯的来区分黑盒/白盒本身肯定不是件很容易的事情,不然就不会有灰盒测试的概念了。
Definitions of Gray box testing:
Gray box testing - Tests involving inputs and outputs, but test design is educated by information about the code or the program operation of a kind that would normally be out of scope of view of the tester.[Cem Kaner]
我第二个例子比较满足这个定义。
Gray box testing - Test designed based on the knowledge of algorithm, internal states, architectures, or other high -level descriptions of the program behavior. [Doug Hoffman]
这个定义好象比较满足你所定义的白盒。从设计测试用例的角度。
Gray box testing - Examines the activity of back-end components during test case execution. Two types of problems that can be encountered during gray-box testing are:
A component encounters a failure of some kind, causing the operation to be aborted. The user interface will typically indicate that an error has occurred.
The test executes in full, but the content of the results is incorrect. Somewhere in the system, a component processed data incorrectly, causing the error in the results.
这个定义非常满足我的第二个例子。是从case的执行角度来说的。
Even though you probably don't have full knowledge of the internals of the product you test, a test strategy based partly on internals is a powerful idea. We call this gray box testing. The concept is simple: If you know something about how the product works on the inside, you can test it better from the outside. This is not to be confused with white box testing, which attempts to cover the internals of the product in detail. In gray box mode, you are testing from the outside of the product, just as you do with black box, but your testing choices are informed by your knowledge of how the underlying components operate and interact. ;
这个定义也非常满足我说的第二个例子。
因此,从概念上来看,我说的例子绝对不属于黑盒测试,非常接近灰盒测试的概念。另外,灰盒和白盒也没有明确的分界线,灰盒本身也没有一个统一的定义。不同的定义也有一定的差别。这里我的理解是,
不懂代码,不懂内部工作就是黑盒。
从代码级详细的进行测试就是白盒。
中间的部分就是灰盒。
不过中间的分界线应该是模糊的,很多例子可能很难清晰的去划分。不过我举的第二个例子,应该算是灰盒。 |
|