# White Box testing - Condition and Branch

I have been reading a number of tutorials about condition and branch testing (coverage). All of them show simple examples, and mention the difference of condition and branch to be that in condition testing compound conditions are considered, and each elementary part of a condition should be tested for True and False. My main problem is that I do not have the big picture. Consider the image below:

I have a simple condition first, a compound condition and another simple condition. So to test conditions (which focuses on elementary parts of a compound condition), it seems I only need to find cases such as x=8 (TF) and x=0.5(FT). However, this seems to ignore other parts of my graph which have branches. Could you please help me understand?

PS. Should I start from statement coverage, and then add missing tests for branch (if required), and then add tests for elementary conditions (if required)?

What you need to do is to do a boundary analysis: Identify which values of your variables have different meanings/effects in the context of your program (in terms of branch execution - since the paths to states 6 and 7 result in the same code to be executed).

In this case, X may mean different things when:

• It's lower than zero;
• It's between zero and one (not including);
• It's between one and four (not including);
• It's between four and seven (not including);
• It's bigger than seven;

As per my knowledge and ISTQB Sllybus, branches are the line and decisions are nodes. Beside that, You should not forget that being a QA or Tester, you need to execute and test each and every path of the program. So atleast, test each decision one time on its true and False values. For more understanding on the statement and decision coverage, You can search for the lecture of Neeraj Kumar Singh on Youtube and he explained it quite well while covering the ISTQB foundation level course.

Thanks