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;
  r=new Reader();

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?

  • did you check respective Wikipedia article: White-box testing?
    – gnat
    Feb 20, 2013 at 19:18
  • gnat, yes I did. It is more about coverage. It does not say anyting about what to test against. Feb 20, 2013 at 19:18
  • @user1134916 You just answered your own question, coverage IS what you test against. Methods, Functions, decision points, classes, you need to find what's important in the code, since you know what it does and where it's supposed to do it, go from there. Feb 20, 2013 at 19:24
  • Jeff Langemeier: no that would not make sense...coverage is a goal. You can test against code or diagrams (flowcharts?)..that is all I can think of Feb 20, 2013 at 19:26
  • @user1134916 hm per my reading of the article, it rather clearly states testing is done against inputs, doesn't it? "The tester chooses inputs to exercise paths through the code and determine the appropriate outputs. "
    – gnat
    Feb 20, 2013 at 19:26

1 Answer 1


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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.