Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
did you check respective Wikipedia article: White-box testing? – gnat Feb 20 '13 at 19:18
gnat, yes I did. It is more about coverage. It does not say anyting about what to test against. – user1134916 Feb 20 '13 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. – Jeff Langemeier Feb 20 '13 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 – user1134916 Feb 20 '13 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 '13 at 19:26

Yes, white box testing is akin to unit tests created by developers.

However, see the following for a discussion:

If they are asking you to white-box test something then you will need to read the code to come up with the tests.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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