I’m wondering, what are the white box testers using to create test cases? The actual code? Some kind of diagrams?
I mean, if I am given a task to create test cases for complete branch coverage, is it possible they give me a code?
Because I saw something like that:
Reader r=null;
if(condition)
{
r=new Reader();
}
r.toString();
There is an obvious bug as the last statement should be in the body of the If statement. It will be easily exposed by false-decision test case of the condition.
But is it not more like unit tests? What is then the white box testers goal of testing?
Wikipedia article on white-box testing states:
The tester chooses inputs to exercise paths through the code and determine the appropriate outputs.
I understand this as you choose inputs to reach the coverage and reveal possible bugs. But isn’t it simple unit testing done by developers?
6
Yes, white box testing is akin to unit tests created by developers.
However, see the following for a discussion:
https://stackoverflow.com/questions/9892963/does-unit-testing-falls-under-white-box-or-black-box-testing
If they are asking you to white-box test something then you will need to read the code to come up with the tests.