Hello everyone! This blog post is about my CS-443 class. Today I will be talking about a very important topic: white vs black! Me personally I love white. It is my favorite and it is clean. Hmm but why are we talking about colors in a software class?! Hmmm….wait a second! We are not talking about colors here, we are talking about testing methods, white and black box. The first time I came across with these two terms was about 6-7 months ago at my work. One of our software testing engineers was giving a presentation about different methods of testing we could use, and white and black testing was part of them. I remember I was researching about these terms after the presentation.
White and black box are two testing methods used in software testing. Both very different methods, but very important.
White box testing is a detailed testing method of the code, logic and structure. In order to perform white box testing the code should be visible to the tester. The tester needs to look inside the source code and figure out what is not working right or what can be improved for more efficiency. Like every other thing in the world these two methods have advantages and disadvantages. Some of the advantages of white box testing method are: It makes it easier for the tester to determine the easiest way of testing and where the code might break; The tester can determine easily which lines are not needed to improve the code efficiency; The tester can provide maximum code coverage. A disadvantage of the white box testing I would mention is that it requires debugging and analyzers tools.
On the other hand, black box testing is the complete opposite of white box testing. In this method the tester doesn’t have any information or knowledge of the source code and the internal structure. The only way of testing using this method is to put random inputs and examine and compare the outputs with what is excepted. In addition, the tester doesn’t have any knowledge how the input is worked upon. Even though this type of testing sound pretty hard to work with, it has its own advantages. The advantages of this testing method are: It is very efficient for large/extremely large amount of code, it would be a waste of time to keep looking at the code; It separates the user’s perspective from developer’s perspective. Some of the disadvantages of this testing method are: Blind coverage; difficulty in designing the tests; limited coverage.
I liked to explain the difference between these two types of testing methods as a lot of people seem confused. To be honest I have heard a lot of people who say that the black box testing is not good to use. I just wanted to say that is depends a lot in the type of testing you are asked to perform. If you are asked to match the outputs with the excepted output, there is really no need to have the code. Of course, it is always great to have access to the source code as a reference, but if we talk about big companies you might want to think it twice about using white box testing.