Blackbox testing and Whitebox testing are terms commonly used in an SDLC (Software Delivery Lifecycle) Although often mentioned in the same breath, they represent two completely different approaches to quality assurance. In a recent episode of the Quality Podcast, Cynthia Maes, Jürgen Meheus and Günter Himschoot delved deep into the matter.
What is it exactly? When do you deploy which technique? And why is the line between the two sometimes grayer than we think? In this article, we summarize the key insights for the professional tester and the curious stakeholder.
In blackbox testing, you think of the software as a “black box. You know what you put in (input) and you know what should come out (output), but exactly how the code inside works is irrelevant to you as a tester.
Focus on specifications
The starting point for Blackbox testing is analysis. Jurgen Meheus explains:
“You’re going to functionally verify that an application meets specifications. What the analyst has captured from the end user and translated into user stories is our input. We look to see if what the developer has built matches the customer’s reality.”
Suppose a requirement states that a user should be blocked after three incorrect login attempts.
Opposite the black box is Whitebox testing (also called Glass Box or Structural testing). Here the internal structure, design and code of the software is visible and forms the basis for testing.
While Blackbox testing focuses on what the software does, Whitebox testing focuses on how the software does it. Here we look at things like:
While pure QA engineers often focus on Blackbox, Whitebox testing is usually performed by developers (e.g., via Unit Tests) or by technical testers who use tools such as SonarQube to monitor code quality.
In practice, the lines between Blackbox and Whitebox are sometimes blurred. This is because software quality is not a black-and-white story. According to M2Q’s experts, it is essential to have a solid testing strategy or test plan ready.
You can never test everything. The choice of technique often depends on a risk analysis.
To take a structured approach to Blackbox testing, several techniques are available. During the podcast, some important ones were discussed:
When an application has many complex combinations of rules, a decision table offers a solution. You write out all possible combinations of inputs to see if the output is correct each time.
In this process, you divide input data into groups (partitions) that you expect the software to treat in the same way.
The shift to Agile working has changed the dynamics of testing. There is less documentation (“as little as possible, but not zero”), which presents both opportunities and challenges.
A common term in Whitebox testing is Code Coverage. Tools can tell you exactly that you hit, say, 80% of the code during your tests. But beware:
“Code coverage says everything about which lines of code have been touched, but nothing about the quality of the code or the quality of your tests,” warns Jurgen.
You can have 100% coverage and still miss a bug because the code simply doesn’t do what the customer asked. That’s why the combination of functional (Blackbox) and structural (Whitebox) testing is so powerful.
The question “When will we be ready?” is perhaps the most difficult in the business. The answer is rarely “when all the bugs are out,” because there is no such thing as 100% bug-free software. You stop when the predetermined acceptance criteria are met and the residual risk is acceptable to the business.
Whether you choose Blackbox, Whitebox, or a hybrid form: the goal remains the same. You want to demonstrate that the application is ready for production and minimize risk to the end user.
Want to dive deeper into the world of Blackbox and Whitebox testing? At M2Q we offer specialized training courses, such as the ISTQB-based training courses, in which chapters are completely dedicated to these techniques. You will learn not only the theory, but more importantly which technique to apply best in which situation.
Want to know more? Check out our training page or listen to the full episode of the Quality Podcast!
Talk to us about the right approach for your business during a free online consultation. Register your consultation with the CEO here.