Hello Folks,
In this post, we will see below topics:
- What is White box testing?
- What is Black box testing?
- What are differences between White box and Black box testing?
There are many testing techniques which are broadly categorised into two: Static Testing and Dynamic Testing.
Dynamic testing is again subdivided into two major categories:
- White box testing or Structure based testing
- Black box testing or Specification based testing
Black Box Testing:
Let’s start with real time example. You go to an electronic shop to purchase a Mobile. Before purchase, you will perform some basic and important checks as below:
- You will insert a sim to check if network comes.
- You are able to make a call and receive a call.
- You are able to hear voice properly.
- Phone should be charged when plug in to a charger.
Did you open mobile components e.g. Circuits, receivers etc and check whether all internal components are working fine? No. You are just concerned whether a mobile is working as expected without concerning about how it does.
So the testing done above is nothing but a black box testing technique.
As per ISTQB, In ‘black-box’ or input/output driven testing techniques, a software tester view the software as a black-box with inputs and outputs, but they have no knowledge of how the system or component is structured inside the box. In essence, the tester is concentrating on what the software does, not how it does it.
Lets; see an example in Software industry.
Suppose you have got an application which allows a patient to register by providing all details. As part of black box testing, you launch the application, provide all details and register a patient. On successful registration you get a confirmation message. You are done. You don’t bother how internally it is done or what logic is being used. You are more concerned about final output which should be as per requirements. If not, you raise a bug.
Black box testing includes both functional and non-functional testing.
There are four techniques inside black box testing which helps you in designing test cases:
- equivalence partitioning
- Boundary value analysis
- Decision tables
- State transition testing
White Box Testing:
Consider the same real time example given in Black box testing. Suppose you are in a mobile manufacturing company. To develop a well functioning mobile device, you need to check all internal components. You are more concerned about how making or receiving a call will work internally rather than just pressing button. You test all receivers, chips design, layout etc. If something is not working, you can fix then and there before end user catches it by performing black box testing.
So in the same way, a white box tester or developer understands the internal working of software to test the functionality. They check logics whether it is written correctly and performing which is expected. It is also called as Glass box testing as you need to see internal components of software to perform testing. It is performed to test code coverage, branch coverage, quality of code etc. It is performed to check conditional statements and decision statements like loops, if , if-else etc.
Difference between Black box and white box testing:
[table id=1 /]
If you have any doubt, feel free to comment below.
If you like my posts, please like, comment, share and subscribe.
#ThanksForReading
#HappyTesting