Grey box testing is when the tester has a partial understanding of the internal structure in the system under test. Grey box testing is a process for debugging software applications by making an input through the front-end, and verifying the data on the back-end.

Grey box testing

We’ve talked about the difference between black box and white box testing before, so lets look at grey box testing in a little more detail.

You may recall black box testing is when the tester is unaware of the internal structure of the system, and white box testing is when the tester has an understanding of, and access to, the internal structure of the system. Grey box testing is essentially a blend of black box and white box testing.

The tester understands the purpose of the system and it’s core functionalities. They also understand the internal workings, however knowledge of the internal workings is limited. The tester usually has access to the database, as well as any design documents.

Using Grey Box Testing

This approach to testing is most useful when testing web applications. It is not extremely useful during the development process as it depends on feature completion. This type of testing aims to test both the front-end functionality of the application as well as the internal workings of the system.

In grey box testing, the tester inputs something to the system and has the ability to check if the results were the expected results. The tester also has the ability to see how the results were obtained. In other words, the tester determines why the results occurred the way they did by looking at the data in the back-end.

Example of Grey Box Testing vs Black Box Testing vs White Box Testing

To better illustrate grey box testing, and how it compares to black box testing and white box testing, let’s take a look at a simple example; testing the hyperlinks on a webpage.

Black Box Testing

The tester checks that the HTML is written properly, pointing to the correct URL with the correct syntax.

White Box Testing

The tester clicks the hyperlink and ensures their browser directs them to the expected URL.

Grey Box Testing

The tester clicks the hyperlink, checks that the HTML is coded properly, and verifies their browser directs them to the expected URL.

Advantages & Disadvantages

With it’s hybrid nature, grey box testing offers benefits from both white box and black box testing but there are also some downsides to following this approach.

Advantages

  • Grey box testing is done from the end-user’s point of view and not the designer or engineer’s perspective.
  • Offers the benefits of both black box and white box testing together.
  • Will be based off functional specifications, user stories and architectural diagrams allowing the original requirements to be verified.
  • Testing will be unbiased as there will be more of a gab between the software testers thoughts and the designer or engineer thoughts.

Disadvantages

  • Grey box testing can also take a lot of time in order to test every single input path, and some times this is not realistic.
  • Will most commonly result in a lower test coverage than performing white and black box testing separately.
  • May not be suitable for testing some types of functionality.

Conclusion

Grey box testing is a hybrid of black box and white box testing. It offers the advantage of understanding the front-end, while also understanding some of the internal workings. But test coverage is limited due to the latter.

Grey box testing provides an excellent way to conduct functional testing at a high level, but it should be combined with more extensive, deeper, white box testing to ensure quality and completion.