http://reqtest.com/testing-blog/white-box-testing-example/
This week we generalize to whitebox testing. Whitebox testing or code based testing as the name implies works at the code based level. This technique does not rely on the specifications but instead provides the programmer with the actual code. Armed with such technical details, programmers can create test cases to test for the success of the system. The key principles to successful testing are the following:
Statement coverage – the simplest type of coverage ensures that every statement is executed.
Branch coverage which ensures that every branch is covered.
Finally, path coverage which ensures that all paths are tested.
Statement and branch coverage does not guarantee full edge coverage. So, above all path coverage is favoured for its comprehensiveness.
For code testing, I have always asked if white-box testing is enough to create a successful, working product when the tester already has the code. What are the advantages of black box testing when whitebox testing should be sufficient?
This article is all about whitebox testing. It poses the question of which is better white box or black box testing, but does to formulate any favoritism for either. Both has advantages/disadvantages depending on the scenario, so neither can be ruled out over the other. As stated in the article, black box testing allows the system to be tested from a user’s point of view. White box testing on the other hand allows the system to be tested from a developer’s point of view.
Black box testing allows the tester to have more perspective on the intended customer/users and tests for the expected results. For new insights, the author seems to favor it during the early stages of product development and the first few sprints in the release. It allows for further progress and development after eliminating “show stopper” bugs. However, from what I have seen black box testing is redundant and consumes too much time. One disadvantage is that test cases are extremely difficult to design when the specifications are unclear and not concise. One advantage is that it can test for boundary conditions.
White Box testing on the other hand, allows the tester to see the code. Therefore, it helps to bring out bugs that would otherwise be missed with black box testing. White box testing as stated helps to fix journeys and scenarios that would have otherwise been considered as exceptions, but that can be damaging in real life in terms of reputational, regulatory, and monetary damages. It allows for code optimizations by revealing hidden bugs. The emphasis on it is that it allows engineering teams to conduct thorough testing of the application by allowing for all possible paths to be covered. So, in my opinion whitebox testing should be given higher weights
I chose this article for generalization and out of interest to learn more about whitebox testing. Although the article does not show favoritism, I am in favor of most of the techniques over black box testing.
From the blog CS@Worcester – Site Title by myxuanonline and used with permission of the author. All other rights reserved by the author.