The Test Shade is Always Gray: Beyond the Notion of Black & White-Box Testing
There are only a few contrasting terms in the testing world which have helped me in understanding the subject better. The distinction between black-box testing and white-box testing is one of them.
However, over a period of time, as I experimented more and more, this distinction became limiting. It puts an upper bar on the testing thought process. So, if I split my 20 years in testing into two halves, in the second half, this distinction started fading away more and more. Although I can acknowledge why these two terms exist and are used, I consciously try to break out these two thought cages. You can do that too if you want.
Before you read further. This discussion is not about what is called what. That does not concern me. I concern myself with limitations on thought that any kind of thinking brings. The binary thinking of black and white box testing as a thought constraint is what I am challenging here.
Back to Basics
Let's get to the basics first.
Testers define different terms differently. It does not matter how you define it. For the purpose of this distinction, I need a starting point. So, I chose to pick up definitions from Wikipedia (I know, I know. Doesn't matter by the time this article ends.).
Here's what Wikipedia says about Black-Box Testing and White-Box Testing, verbatim:
Black-box testing is a method of software testing that examines the functionality of an application without peering into its internal structures or workings. This method of test can be applied virtually to every level of software testing: unit, integration, system and acceptance. It is sometimes referred to as specification-based testing. - Wikipedia, Retrieved on 17 July, 2023.
White-box testing (also known as clear box testing, glass box testing, transparent box testing, and structural testing) is a method of software testing that tests internal structures or workings of an application, as opposed to its functionality (i.e. black-box testing). - Wikipedia, Retrieved on 17 July, 2023.
Some initial thoughts for you from these definitions:
When you start with a categorisation mind-set, it no more remains about just distinction between 2 words/phrases, you will start segregating a whole world of concepts into two boxes and end up force-fitting. This force-fitting then indirectly puts limitations on thinking and the quality of testing that one does.
Here's an exercise for you: although unrelated, but just do a thorough search (beyond your own thought) to find what different testers mean by error, mistake, fault, defect, bug, failure, discrepancy, issue, problem, cause, root cause. Have fun! But please spare me as rather than fun I find all this funny :-).
A Directional Bias
In my thought process when I see a thought leading in only one direction, I question myself why?
This has helped me break many biases in my mind as well as understand constraints.
The usual black-box testing thought process has a subtle directional bias to it.
As a tester we typically talk to a test object via an interface. What is to the right of / behind that interface can be thought of as a black box. That's what I infer from the way testers talk. There is an assumption in this as if know everything about what is on the left where we sit, the Primary Point of Control .
What most testers fail to realise is that this is how the directional bias comes into play:
The truth, though, is something else and in itself is a liberating one:
Here's a break-down of this thought process:
Following is a more generalised version of the previous visual which further generalises and simplifies it:
领英推荐
Further Thoughts for Self-Labeled Black-Box and White-Box Testers
Example: You fill a form in a web application deliberately with wrong data and when you click submit button, there is an error message as expected. Most testers relate this functionality to the web application as a black box and are happy with it. Let's break it down a few steps. Who rejected this form data? Client-side JavaScript or the web application server? This single answer can further build the basis for a security test. If it were just a client side rejection, you can apply the GOLF Heuristic - Go One Layer Further and conduct the same test to find a different answer.
Example: You are testing a file creating functionality in a code base. This code makes a library call to a third party lib. Did you go through its code? Or that lib is a black box? What about the call that this said library is making to the built-in library of the programming language? And then a subsequent call to the OS's user mode? And then to kernel mode? and so on. You see, at some point this white-box thought process will hit a black box as far as you are concerned. It will be outside your Gray Zone.
Further Thoughts Beyond Such Labels
As a tester it will help you to think that you are in the middle of something rather than at the edge of something.
Look both ways. Rather, look around from your current locus/point of thought.
E.g. when you are designing a scenario at the top most layer of your system, even then you don't know the internals of a system that consumes your system or how a user is actually going to use it.
The other direction of thought, is already discussed above.
This article, if you read between the lines, is an extension to what I wrote in the article on the GOLF Heuristic - Go One Layer Further .
That's all for now.
Related Articles: