There are different ways to classify tests. One of them is considering how much we know about the internal structure of the system we are testing. In this way, the tests are classified as white box, black box or gray box testing. In the black box tests we do not know the internal structure of the system. We do not know how it is built, which is the technology or the architecture, etc. However, we can design the tests by observing the inputs and outputs of the system which are usually described in the functional models. This is the type of testing that functional testers generally do.
On the other hand, when we build the test cases from the program structure, we are doing white box tests. In other words, the test cases are assembled from the code, the data or control flow, the structure of the database, etc. This does not mean that we are going to be looking for defects in the code. That is something different and it is called static analysis.
Many times the boundary is not clear, or perhaps we are following a black box approach, but since we know something of what is going on inside then we take advantage of that information. And this is what is often called a "gray box test." These tests result from the combination of both approaches. For more information on this classification, I invite you to watch the video.
Spanish version
English version
Courses that might interest you...
Introduction to testing Artificial Intelligence systems
Frequently asked questions
What is black box testing?
Tests in which we do not know the internal structure of the system and design them by observing its inputs and outputs. They are the ones functional testers usually do.
What are white box and gray box testing?
In white box testing we build test cases from the structure of the program: the code, the data or control flow, the database structure. Gray box testing combines both approaches: we follow a black box approach, but we use what we know about what happens inside.
Keep reading: Functional and non-functional tests and What are unit tests?. If you want to go deeper, I recommend the course Foundation Level Certification Course.